Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_fifo.cc')
-rw-r--r--winsup/cygwin/fhandler_fifo.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 4ff94bb4e..742b70c10 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -184,14 +184,15 @@ fhandler_fifo::dup (fhandler_base *child)
if (!res)
{
fhandler_fifo *ff = (fhandler_fifo *) child;
- if (!DuplicateHandle (hMainProc, get_output_handle (), hMainProc,
- &ff->get_output_handle (), false, true,
- DUPLICATE_SAME_ACCESS))
+ if (get_output_handle ()
+ && !DuplicateHandle (hMainProc, get_output_handle (), hMainProc,
+ &ff->get_output_handle (), false, true,
+ DUPLICATE_SAME_ACCESS))
{
__seterrno ();
child->close ();
res = -1;
}
}
- return 0;
+ return res;
}