|
From: <sk...@us...> - 2011-08-09 05:43:15
|
Revision: 2429
http://linuxconsole.svn.sourceforge.net/linuxconsole/?rev=2429&view=rev
Author: skitt
Date: 2011-08-09 05:43:09 +0000 (Tue, 09 Aug 2011)
Log Message:
-----------
Avoid resetting the line discipline if another instance of inputattach is already running.
Modified Paths:
--------------
trunk/utils/inputattach.c
Modified: trunk/utils/inputattach.c
===================================================================
--- trunk/utils/inputattach.c 2011-06-25 13:19:12 UTC (rev 2428)
+++ trunk/utils/inputattach.c 2011-08-09 05:43:09 UTC (rev 2429)
@@ -626,6 +626,7 @@
int baud = -1;
int ignore_init_res = 0;
int no_init = 0;
+ int one_read = 0;
for (i = 1; i < argc; i++) {
if (!strcasecmp(argv[i], "--help")) {
@@ -746,11 +747,17 @@
if (i == -1) {
if (RETRY_ERROR(errno))
continue;
+ } else {
+ one_read = 1;
}
} while (!i);
ldisc = 0;
- ioctl(fd, TIOCSETD, &ldisc);
+ if (one_read) {
+ // If we've never managed to read, avoid resetting the line
+ // discipline - another inputattach is probably running
+ ioctl(fd, TIOCSETD, &ldisc);
+ }
close(fd);
return retval;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|