From 3c9d53d98102887698af1c1b3655274207e7c941 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Fri, 31 Dec 2004 11:49:22 +0000 Subject: [PATCH] Don't close pty_slave and real_ttyfd in connect_tty if an error occurs; link_required calls cleanup_tty if connect_tty returns an error, and that does the closing. Doing the closes in connect_tty meant that the disconnector couldn't run and the tty mode couldn't be restored. --- pppd/tty.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pppd/tty.c b/pppd/tty.c index a911fde..c11d039 100644 --- a/pppd/tty.c +++ b/pppd/tty.c @@ -68,7 +68,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: tty.c,v 1.22 2004/11/13 12:07:29 paulus Exp $" +#define RCSID "$Id: tty.c,v 1.23 2004/12/31 11:49:22 paulus Exp $" #include #include @@ -755,14 +755,6 @@ int connect_tty() close(pty_master); pty_master = -1; } - if (pty_slave >= 0) { - close(pty_slave); - pty_slave = -1; - } - if (real_ttyfd >= 0) { - close(real_ttyfd); - real_ttyfd = -1; - } ttyfd = -1; if (got_sigterm) asked_to_quit = 1; -- 2.39.2