summaryrefslogtreecommitdiffstats
path: root/pty.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-09-05 07:13:06 +0200
committerDamien Miller <djm@mindrot.org>2000-09-05 07:13:06 +0200
commitbac2d8aa5e642a70045e713853b13d020b9c5d57 (patch)
tree98ddc81efce2273b3dfaff03b51242c988d30abf /pty.c
parentFix spec files (diff)
downloadopenssh-bac2d8aa5e642a70045e713853b13d020b9c5d57.tar.xz
openssh-bac2d8aa5e642a70045e713853b13d020b9c5d57.zip
- (djm) Merge cygwin support from Corinna Vinschen <vinschen@cygnus.com>
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 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));
@@ -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);