From: Russell Coker Date: Sun, 24 Nov 2002 12:02:02 +0000 (+0000) Subject: Added a fix for a situation where pppd would hang indefinately on exit. X-Git-Tag: ppp-2.4.7~353 X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=1b032c687deba56230f89ff5217e0a0ea445698f;p=ppp.git Added a fix for a situation where pppd would hang indefinately on exit. --- diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index c86a516..5751651 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -517,7 +517,10 @@ void tty_disestablish_ppp(int tty_fd) * Flush the tty output buffer so that the TIOCSETD doesn't hang. */ if (tcflush(tty_fd, TCIOFLUSH) < 0) + { warn("tcflush failed: %m"); + goto flushfailed; + } /* * Restore the previous line discipline */ @@ -537,6 +540,7 @@ void tty_disestablish_ppp(int tty_fd) warn("Couldn't restore device fd flags: %m"); } } +flushfailed: initfdflags = -1; generic_disestablish_ppp(tty_fd);