From 5f2af3d543a4449b0a6c4db1b4a920f9422c1183 Mon Sep 17 00:00:00 2001 From: ayin Date: Tue, 26 Jun 2007 00:40:28 +0000 Subject: [PATCH] *** empty log message *** --- src/ptytty.C | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ptytty.C b/src/ptytty.C index d40e9d3d..2c350581 100644 --- a/src/ptytty.C +++ b/src/ptytty.C @@ -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 */ @@ -107,7 +107,7 @@ int pfd; int res; char tty_name[32]; - + res = openpty (&pfd, fd_tty, tty_name, NULL, NULL); if (res != -1) @@ -208,7 +208,7 @@ /*----------------------------------------------------------------------*/ /* - * 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) -- 2.34.1