From: ayin Date: Tue, 26 Jun 2007 21:30:10 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=126e8801f9ee93d1fff7611a0379fe4a5ff650cf;p=dana%2Furxvt.git *** empty log message *** --- 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 */