aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/pipe.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-03-22 18:30:58 +0000
committerChristopher Faylor <me@cgf.cx>2003-03-22 18:30:58 +0000
commitff3ef36d88dc4b3e632e30df7e077a573b77b3f7 (patch)
treeb4cc26b164ebef67f5863d6bfd649555076168a4 /winsup/cygwin/pipe.cc
parentca04f61fc7b7d38bb21db969ec8b70007bde868f (diff)
downloadnewlib-ff3ef36d88dc4b3e632e30df7e077a573b77b3f7.zip
newlib-ff3ef36d88dc4b3e632e30df7e077a573b77b3f7.tar.gz
newlib-ff3ef36d88dc4b3e632e30df7e077a573b77b3f7.tar.bz2
* pipe.cc (fhandler_pipe::dup): Don't dup input_handle if it doesn't exist.
Diffstat (limited to 'winsup/cygwin/pipe.cc')
-rw-r--r--winsup/cygwin/pipe.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc
index f131fd4..a84aeee 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;