summaryrefslogtreecommitdiff
path: root/pty.c
diff options
context:
space:
mode:
Diffstat (limited to 'pty.c')
-rw-r--r--pty.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/pty.c b/pty.c
index f5bb8612..d610a454 100644
--- a/pty.c
+++ b/pty.c
@@ -118,6 +118,7 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen)
close(*ptyfd);
return 0;
}
+#ifndef HAVE_CYGWIN
/* Push the appropriate streams modules, as described in Solaris pts(7). */
if (ioctl(*ttyfd, I_PUSH, "ptem") < 0)
error("ioctl I_PUSH ptem: %.100s", strerror(errno));
@@ -127,6 +128,7 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen)
if (ioctl(*ttyfd, I_PUSH, "ttcompat") < 0)
error("ioctl I_PUSH ttcompat: %.100s", strerror(errno));
#endif
+#endif
return 1;
#else /* HAVE_DEV_PTMX */
#ifdef HAVE_DEV_PTS_AND_PTC
@@ -208,9 +210,9 @@ void
pty_make_controlling_tty(int *ttyfd, const char *ttyname)
{
int fd;
-#ifdef HAVE_VHANGUP
+#ifdef USE_VHANGUP
void *old;
-#endif /* HAVE_VHANGUP */
+#endif /* USE_VHANGUP */
/* First disconnect from the old controlling tty. */
#ifdef TIOCNOTTY
@@ -242,21 +244,21 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
*/
ioctl(*ttyfd, TIOCSCTTY, NULL);
#endif /* TIOCSCTTY */
-#ifdef HAVE_VHANGUP
+#ifdef USE_VHANGUP
old = signal(SIGHUP, SIG_IGN);
vhangup();
signal(SIGHUP, old);
-#endif /* HAVE_VHANGUP */
+#endif /* USE_VHANGUP */
fd = open(ttyname, O_RDWR);
if (fd < 0) {
error("%.100s: %.100s", ttyname, strerror(errno));
} else {
-#ifdef HAVE_VHANGUP
+#ifdef USE_VHANGUP
close(*ttyfd);
*ttyfd = fd;
-#else /* HAVE_VHANGUP */
+#else /* USE_VHANGUP */
close(fd);
-#endif /* HAVE_VHANGUP */
+#endif /* USE_VHANGUP */
}
/* Verify that we now have a controlling tty. */
fd = open("/dev/tty", O_WRONLY);