From ff3ef36d88dc4b3e632e30df7e077a573b77b3f7 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 22 Mar 2003 18:30:58 +0000 Subject: [PATCH] * pipe.cc (fhandler_pipe::dup): Don't dup input_handle if it doesn't exist. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/pipe.cc | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 666dc3a78..c74f46fa6 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-03-22 Christopher Faylor + + * pipe.cc (fhandler_pipe::dup): Don't dup input_handle if it doesn't + exist. + 2003-03-22 Christopher Faylor * syscalls.cc (unlink): Be more defensive when SetFileAttributes is diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc index f131fd43f..a84aeee60 100644 --- a/winsup/cygwin/pipe.cc +++ b/winsup/cygwin/pipe.cc @@ -133,9 +133,12 @@ fhandler_pipe::fixup_after_fork (HANDLE parent) int fhandler_pipe::dup (fhandler_base *child) { - int res = fhandler_base::dup (child); - if (res) - return res; + if (get_handle ()) + { + int res = fhandler_base::dup (child); + if (res) + return res; + } fhandler_pipe *ftp = (fhandler_pipe *) child;