From f3acbe3e3fe8439c303d99d42c60c724d0f1a558 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 10 Sep 2001 02:11:59 +0000 Subject: [PATCH] * dtable.cc (dtable::fixup_after_fork): Use SetStdHandle appropriately on inherited fds. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/dtable.cc | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f8f393a8f..6bdc2fac2 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Sun Sep 9 22:11:27 2001 Christopher Faylor + + * dtable.cc (dtable::fixup_after_fork): Use SetStdHandle appropriately + on inherited fds. + Sun Sep 9 20:09:11 2001 Christopher Faylor * sigproc.cc (NZOMBIES): Reduce substantially to minimize memory use. diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 0b3ad2575..5dc56ee64 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -536,6 +536,10 @@ dtable::fixup_after_fork (HANDLE parent) debug_printf ("fd %d (%s)", i, fh->get_name ()); fh->fixup_after_fork (parent); } + if (i == 0) + SetStdHandle (std_consts[i], fh->get_io_handle ()); + else if (i <= 2) + SetStdHandle (std_consts[i], fh->get_output_handle ()); } }