From bac2d8aa5e642a70045e713853b13d020b9c5d57 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 5 Sep 2000 16:13:06 +1100 Subject: - (djm) Merge cygwin support from Corinna Vinschen --- pty.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'pty.c') diff --git a/pty.c b/pty.c index f5bb86124..d610a4543 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)); @@ -126,6 +127,7 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) #ifndef _HPUX_SOURCE if (ioctl(*ttyfd, I_PUSH, "ttcompat") < 0) error("ioctl I_PUSH ttcompat: %.100s", strerror(errno)); +#endif #endif return 1; #else /* HAVE_DEV_PTMX */ @@ -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); -- cgit v1.2.3