summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_fifo.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-06-07 18:41:31 +0000
committerChristopher Faylor <me@cgf.cx>2005-06-07 18:41:31 +0000
commitb739751db982170d8e10caa720e5c6a5a1918f37 (patch)
tree42c773457d8aeecd5fd6a06e076da04410f0d38b /winsup/cygwin/fhandler_fifo.cc
parent7066fc51d74c0a9e3b85350617e889db92816d59 (diff)
downloadcygnal-b739751db982170d8e10caa720e5c6a5a1918f37.tar.gz
cygnal-b739751db982170d8e10caa720e5c6a5a1918f37.tar.bz2
cygnal-b739751db982170d8e10caa720e5c6a5a1918f37.zip
* cygthread.cc (cygthread::detach): Make error message a little more detailed.
* fhandler.cc (fhandler_base::raw_read): Ditto for debug message. * dcrt0.cc (do_exit): Add some more synchronization tests. * fhandler_fifo.cc (fhandler_fifo::dup): Don't duplicate a nonexistent handle. Use derived return value rather than always retuning 0. * fhandler_netdrive.cc (fhandler_netdrive::exists): Wnet -> WNet. * winsup.h (exit_states): Add a couple of new exit states.
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;
}