From: Paul Mackerras Date: Thu, 13 May 1999 00:34:54 +0000 (+0000) Subject: just do tcflush once, should be enough X-Git-Tag: ppp-2.4.7~700 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=bf6d4acfc182ce5e36754291fb5e1c0cde564b36 just do tcflush once, should be enough --- diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 7cae7ce..94c31dd 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -381,20 +381,12 @@ int establish_ppp (int tty_fd) void disestablish_ppp(int tty_fd) { - int nout; - if (!hungup) { /* * Flush the tty output buffer so that the TIOCSETD doesn't hang. - * We may have to do this several times because the tcflush only - * affects the serial driver, and may trigger the ppp driver to - * supply more data to the serial driver. */ - do { - if (tcflush(tty_fd, TCIOFLUSH) < 0) - break; - nout = 0; - } while (ioctl(tty_fd, TIOCOUTQ, &nout) >= 0 && nout > 0); + if (tcflush(tty_fd, TCIOFLUSH) < 0) + warn("tcflush failed: %m"); /* * Restore the previous line discipline */