diff options
author | Christopher Faylor <me@cgf.cx> | 2004-01-24 01:53:58 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-01-24 01:53:58 +0000 |
commit | f687a788d7120fd2415ac362205c1ec91b083d83 (patch) | |
tree | 9b151cdc5dfb24fcb85baa8397744c85a1e58ccf /winsup/cygwin/debug.h | |
parent | be287e357921486f71c5679b1b8d3902640166aa (diff) | |
download | newlib-f687a788d7120fd2415ac362205c1ec91b083d83.zip newlib-f687a788d7120fd2415ac362205c1ec91b083d83.tar.gz newlib-f687a788d7120fd2415ac362205c1ec91b083d83.tar.bz2 |
* fhandler_socket.cc (fhandler_socket::create_secret_event): Avoid creating
multiple handles. Always allow event inheritance but set the handle
inheritance appropriately. Improve error handling.
(fhandler_socket::check_peer_secret_event): Improve error handling.
(fhandler_socket::close_secret_event): Simply call CloseHandle.
(fhandler_socket::set_close_on_exec): Set secret event inheritance.
* configure.in: Remove NEWVFORK default.
* configure: Regenerate.
* dcrt0.cc: Conditionalize vfork stuff throughout.
* dtable.cc: Ditto.
* perthread.h: Ditto.
* pipe.cc (fhandler_pipe::close): Ditto.
* spawn.cc (spawnve): Ditto.
* syscalls.cc (setsid): Ditto.
* exceptions.cc (sigpacket::process): Use macro to refer to vfork pid.
* debug.cc (verify_handle): Define new function.
* debug.h (VerifyHandle): Define new macro.
(verify_handle): Declare new function
* fhandler.cc (fhandler_base::dup): Verify that dup'ed handle is not supposed
to be in use.
(fhandler_base::set_inheritance): Ditto.
(fhandler_base::fork_fixup): Ditto.
* fhandler_socket.cc (fhandler_socket::dup): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
* net.cc (set_socket_inheritance): Ditto.
* pinfo.cc (pinfo_fixup_after_exec): Ditto.
* sigproc.cc (proc_subproc): Ditto.
(sig_send): Ditto.
* spawn.cc (spawn_guts): Ditto.
* thread.cc (pthread::init_mainthread): Ditto.
* pipe.cc (fhandler_pipe::close): Close read_state with ForceCloseHandle since
it was protected.
(fhandler_pipe::fixup_after_exec): Protect read_state handle.
(fhandler_pipe::dup): Correctly close open handles on error condition. Verify
that dup'ed handle is not supposed to be in use.
(fhandler_pipe::create): Protect read_state.
Diffstat (limited to 'winsup/cygwin/debug.h')
-rw-r--r-- | winsup/cygwin/debug.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/winsup/cygwin/debug.h b/winsup/cygwin/debug.h index 8941bae..f4f00c6 100644 --- a/winsup/cygwin/debug.h +++ b/winsup/cygwin/debug.h @@ -37,6 +37,7 @@ details. */ # define debug_init() do {} while (0) # define setclexec(h, nh, b) do {} while (0) # define debug_fixup_after_fork_exec() do {} while (0) +# define VerifyHandle(h) do {} while (0) #else @@ -59,10 +60,13 @@ details. */ # define ProtectHandleINH(h) add_handle (__PRETTY_FUNCTION__, __LINE__, (h), #h, 1) # define ProtectHandle1INH(h, n) add_handle (__PRETTY_FUNCTION__, __LINE__, (h), #n, 1) # define ProtectHandle2INH(h, n) add_handle (__PRETTY_FUNCTION__, __LINE__, (h), n, 1) +# define VerifyHandle(h) verify_handle (__PRETTY_FUNCTION__, __LINE__, (h)) void debug_init (); void __stdcall add_handle (const char *, int, HANDLE, const char *, bool = false) __attribute__ ((regparm (3))); +void __stdcall verify_handle (const char *, int, HANDLE) + __attribute__ ((regparm (3))); bool __stdcall close_handle (const char *, int, HANDLE, const char *, bool) __attribute__ ((regparm (3))); void __stdcall cygbench (const char *s) __attribute__ ((regparm (1))); |