--- ppp-2.4.2/pppd/sys-linux.c.alt-hangup-hack 2006-09-19 17:53:57 +0400 +++ ppp-2.4.2/pppd/sys-linux.c 2006-09-19 18:14:08 +0400 @@ -556,14 +556,14 @@ int generic_establish_ppp (int fd) void tty_disestablish_ppp(int tty_fd) { - if (!hungup) { /* * Flush the tty output buffer so that the TIOCSETD doesn't hang. */ if (tcflush(tty_fd, TCIOFLUSH) < 0) { warn("tcflush failed: %m"); - goto flushfailed; + if (!hungup) + goto flushfailed; } /* * Restore the previous line discipline @@ -583,7 +583,6 @@ void tty_disestablish_ppp(int tty_fd) if ( ! ok_error (errno)) warn("Couldn't restore device fd flags: %m"); } - } flushfailed: initfdflags = -1;