summaryrefslogtreecommitdiff
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 33bd0a5ff..23ecc41ca 100644
--- a/scp.c
+++ b/scp.c
@@ -1117,8 +1117,17 @@ foregroundproc()
1117 if (pgrp == -1) 1117 if (pgrp == -1)
1118 pgrp = getpgrp(); 1118 pgrp = getpgrp();
1119 1119
1120#ifdef HAVE_CYGWIN
1121 /*
1122 * Cygwin only supports tcgetpgrp() for getting the controlling tty
1123 * currently.
1124 */
1125 return ((ctty_pgrp = tcgetpgrp(STDOUT_FILENO)) != -1 &&
1126 ctty_pgrp == pgrp);
1127#else
1120 return ((ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) != -1 && 1128 return ((ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) != -1 &&
1121 ctty_pgrp == pgrp)); 1129 ctty_pgrp == pgrp));
1130#endif
1122} 1131}
1123 1132
1124void 1133void