diff options
Diffstat (limited to 'winsup/cygwin/fhandler_termios.cc')
-rw-r--r-- | winsup/cygwin/fhandler_termios.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc index 8bdfdcd5d..b5d9f2ef3 100644 --- a/winsup/cygwin/fhandler_termios.cc +++ b/winsup/cygwin/fhandler_termios.cc @@ -99,7 +99,16 @@ fhandler_termios::tcsetpgrp (const pid_t pgid) int fhandler_termios::tcgetpgrp () { - return tc->pgid; + if (myself->ctty != -1 && myself->ctty == tc->ntty) + return tc->pgid; + set_errno (ENOTTY); + return -1; +} + +int +fhandler_pty_master::tcgetpgrp () +{ + return myself->ctty != -1 && myself->ctty == tc->ntty ? tc->pgid : 0; } void |