summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e889f09)
This avoids having the tcsetsf and the close of the tty device block
for long periods waiting for output to drain, as can happen if for
instance the serial port is in CRTSCTS mode and CTS is negated.
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define RCSID "$Id: tty.c,v 1.25 2006/06/04 07:04:57 paulus Exp $"
+#define RCSID "$Id: tty.c,v 1.26 2008/06/23 11:44:06 paulus Exp $"
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
if (device_script(initializer, ttyfd, ttyfd, 0) < 0) {
error("Initializer script failed");
status = EXIT_INIT_FAILED;
if (device_script(initializer, ttyfd, ttyfd, 0) < 0) {
error("Initializer script failed");
status = EXIT_INIT_FAILED;
}
if (got_sigterm) {
disconnect_tty();
}
if (got_sigterm) {
disconnect_tty();
}
info("Serial port initialized.");
}
}
info("Serial port initialized.");
}
if (device_script(connector, ttyfd, ttyfd, 0) < 0) {
error("Connect script failed");
status = EXIT_CONNECT_FAILED;
if (device_script(connector, ttyfd, ttyfd, 0) < 0) {
error("Connect script failed");
status = EXIT_CONNECT_FAILED;
}
if (got_sigterm) {
disconnect_tty();
}
if (got_sigterm) {
disconnect_tty();
}
info("Serial connection established.");
}
}
info("Serial connection established.");
}
+ errretf:
+ if (real_ttyfd >= 0)
+ tcflush(real_ttyfd, TCIOFLUSH);
errret:
if (pty_master >= 0) {
close(pty_master);
errret:
if (pty_master >= 0) {
close(pty_master);
exit(0);
}
charshunt_pid = cpid;
exit(0);
}
charshunt_pid = cpid;
- record_child(cpid, "pppd (charshunt)", charshunt_done, NULL);
+ record_child(cpid, "pppd (charshunt)", charshunt_done, NULL, 1);