]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/sys-linux.c
just do tcflush once, should be enough
[ppp.git] / pppd / sys-linux.c
index 7cae7ce780f58b5bee07710e298ab6fb2ab842b2..94c31ddc441f25b8d45d9052c39297f86fa86fb8 100644 (file)
@@ -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
  */