- (djm) Merge cygwin support from Corinna Vinschen <vinschen@cygnus.com>
diff --git a/pty.c b/pty.c
index f5bb861..d610a45 100644
--- a/pty.c
+++ b/pty.c
@@ -118,6 +118,7 @@
 		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 @@
 	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 @@
 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 @@
 	 */
 	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);