summaryrefslogtreecommitdiffstats
path: root/scp.c
diff options
context:
space:
mode:
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/scp.c b/scp.c
index 33bd0a5f..23ecc41c 100644
--- a/scp.c
+++ b/scp.c
@@ -1117,8 +1117,17 @@ foregroundproc()
if (pgrp == -1)
pgrp = getpgrp();
+#ifdef HAVE_CYGWIN
+ /*
+ * Cygwin only supports tcgetpgrp() for getting the controlling tty
+ * currently.
+ */
+ return ((ctty_pgrp = tcgetpgrp(STDOUT_FILENO)) != -1 &&
+ ctty_pgrp == pgrp);
+#else
return ((ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) != -1 &&
ctty_pgrp == pgrp));
+#endif
}
void