From 126e8801f9ee93d1fff7611a0379fe4a5ff650cf Mon Sep 17 00:00:00 2001 From: ayin Date: Tue, 26 Jun 2007 21:30:10 +0000 Subject: [PATCH] *** empty log message *** --- src/ptytty.C | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ptytty.C b/src/ptytty.C index 2c350581..384c38fb 100644 --- a/src/ptytty.C +++ b/src/ptytty.C @@ -223,6 +223,8 @@ get_tty (char *ttydev) static int control_tty (int fd_tty) { + int fd; + setsid (); #if defined(HAVE_DEV_PTMX) && defined(I_PUSH) @@ -256,12 +258,12 @@ control_tty (int fd_tty) #ifdef TIOCSCTTY ioctl (fd_tty, TIOCSCTTY, NULL); #else - fd = open (name, O_RDWR); + fd = open (ttyname (fd_tty), O_RDWR); if (fd >= 0) close (fd); #endif - int fd = open ("/dev/tty", O_WRONLY); + fd = open ("/dev/tty", O_WRONLY); if (fd < 0) return -1; /* fatal */ -- 2.34.1