summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-10-22 21:09:41 +0000
committerChristopher Faylor <me@cgf.cx>2001-10-22 21:09:41 +0000
commita05d38a8b4d277faa3643abff50ce5cb4fa6268e (patch)
treeae16b8a89588377ff8ec3b70d6cadafa34acc9bf /winsup/cygwin/fhandler.cc
parente7e231e531e62fbda5d7d019ca5d90363a955881 (diff)
downloadcygnal-a05d38a8b4d277faa3643abff50ce5cb4fa6268e.tar.gz
cygnal-a05d38a8b4d277faa3643abff50ce5cb4fa6268e.tar.bz2
cygnal-a05d38a8b4d277faa3643abff50ce5cb4fa6268e.zip
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc5
1 files changed, 3 insertions, 2 deletions
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
}