summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 66dffdc64..bd91551d6 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -1464,17 +1464,23 @@ fhandler_base::set_no_inheritance (HANDLE &h, int not_inheriting)
#endif
}
-void
+bool
fhandler_base::fork_fixup (HANDLE parent, HANDLE &h, const char *name)
{
HANDLE oh = h;
+ bool res = false;
if (/* !is_socket () && */ !close_on_exec ())
debug_printf ("handle %p already opened", h);
else if (!DuplicateHandle (parent, h, hMainProc, &h, 0, !close_on_exec (),
DUPLICATE_SAME_ACCESS))
system_printf ("%s - %E, handle %s<%p>", get_name (), name, h);
- else if (oh != h)
- VerifyHandle (h);
+ else
+ {
+ if (oh != h)
+ VerifyHandle (h);
+ res = true;
+ }
+ return res;
}
void