*** empty log message ***
authorayin <ayin>
Tue, 26 Jun 2007 21:30:10 +0000 (21:30 +0000)
committerayin <ayin>
Tue, 26 Jun 2007 21:30:10 +0000 (21:30 +0000)
src/ptytty.C

index 2c350581ea52e1d999be387d1518720571bdb1b3..384c38fbdd0fb6b2e93bb21ba7f155de641d4e62 100644 (file)
@@ -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 */