Added a fix for a situation where pppd would hang indefinately on exit.
authorRussell Coker <russell@coker.com.au>
Sun, 24 Nov 2002 12:02:02 +0000 (12:02 +0000)
committerRussell Coker <russell@coker.com.au>
Sun, 24 Nov 2002 12:02:02 +0000 (12:02 +0000)
pppd/sys-linux.c

index c86a516f0aad475be0818e6cd167798a4fd1ad49..5751651c944b1016a20efc950f820e859b938be9 100644 (file)
@@ -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);