From a05d38a8b4d277faa3643abff50ce5cb4fa6268e Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 22 Oct 2001 21:09:41 +0000 Subject: * debug.cc (set_errno): Return value of errno that was set, just like the macro. (setclexec_pid): Replace old handle with new handle. * debug.h: Reflect change in arguments for setclexec_pid. * fhandler.cc (fhandler_base::set_inheritance): Ditto. (fhandler_base::fork_fixup): Ditto. * cygerrno.h: Reflect return value change for set_errno. --- winsup/cygwin/fhandler.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/fhandler.cc') diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 2e6100a3a..cc205c087 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1611,6 +1611,7 @@ fhandler_dev_null::dump (void) void fhandler_base::set_inheritance (HANDLE &h, int not_inheriting) { + HANDLE oh = h; /* Note that we could use SetHandleInformation here but it is not available on all platforms. Test cases seem to indicate that using DuplicateHandle in this fashion does not actually close the original handle, which is @@ -1620,7 +1621,7 @@ fhandler_base::set_inheritance (HANDLE &h, int not_inheriting) DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)) debug_printf ("DuplicateHandle failed, %E"); #ifdef DEBUGGING - setclexec_pid (h, not_inheriting); + setclexec_pid (oh, h, not_inheriting); #endif } @@ -1640,7 +1641,7 @@ fhandler_base::fork_fixup (HANDLE parent, HANDLE &h, const char *name) { debug_printf ("%s success - oldh %p, h %p", get_name (), oh, h); // someday, maybe ProtectHandle2 (h, name); - setclexec_pid (h, !get_close_on_exec ()); + setclexec_pid (h, h, !get_close_on_exec ()); } #endif } -- cgit v1.2.3