summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authordjm <djm>2000-09-05 05:13:06 +0000
committerdjm <djm>2000-09-05 05:13:06 +0000
commitef6b288652255f4efeee427d80c1dc88f8661c6b (patch)
tree134fa639cff379ad40914eb85aa445ad864b0697 /scp.c
parenta55bea016086bffe9a2b8295468d833a8ebc99c4 (diff)
downloadopenssh-ef6b288652255f4efeee427d80c1dc88f8661c6b.tar.gz
- (djm) Merge cygwin support from Corinna Vinschen <vinschen@cygnus.com>
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