summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/spawn.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 08d52bb28..f7c6dd590 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -947,6 +947,15 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
{
FreeConsole ();
AttachConsole (pid_restore);
+ cygheap_fdenum cfd (false);
+ int fd;
+ while ((fd = cfd.next ()) >= 0)
+ if (cfd->get_major () == DEV_PTYS_MAJOR)
+ {
+ fhandler_pty_slave *ptys =
+ (fhandler_pty_slave *) (fhandler_base *) cfd;
+ ptys->fixup_after_attach (false, fd);
+ }
}
return (int) res;