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

index d40e9d3..2c35058 100644 (file)
@@ -65,7 +65,7 @@
  *                  GET PSEUDO TELETYPE - MASTER AND SLAVE                   *
  * ------------------------------------------------------------------------- */
 /*
- * Returns pty file descriptor, or -1 on failure 
+ * Returns pty file descriptor, or -1 on failure
  * If successful, ttydev is set to the name of the slave device.
  * fd_tty _may_ also be set to an open fd to the slave device
  */
     int pfd;
     int res;
     char tty_name[32];
-    
+
     res = openpty (&pfd, fd_tty, tty_name, NULL, NULL);
 
     if (res != -1)
 
 /*----------------------------------------------------------------------*/
 /*
- * Returns tty file descriptor, or -1 on failure 
+ * Returns tty file descriptor, or -1 on failure
  */
 static int
 get_tty (char *ttydev)
@@ -253,7 +253,13 @@ control_tty (int fd_tty)
     }
 #endif
 
+#ifdef TIOCSCTTY
   ioctl (fd_tty, TIOCSCTTY, NULL);
+#else
+  fd = open (name, O_RDWR);
+  if (fd >= 0)
+    close (fd);
+#endif
 
   int fd = open ("/dev/tty", O_WRONLY);
   if (fd < 0)