* debug.h (ModifyHandle): Define new macro.
(modify_handle): Declare new function. * debug.cc (modify_handle): Define new function. * fhandler.h (fhandler_base::fork_fixup): Change return value from void to bool. * fhandler.cc (fhandler_base::fork_fixup): Return true if fork fixup has been done. * pipe.cc (fhandler_pipe::set_close_on_exec): Set inheritance of protected handle via ModifyHandle if DEBUGGING. (fhandler_pipe::fixup_after_fork): Protect guard handle if fork fixup has been done.
This commit is contained in:
@ -114,6 +114,20 @@ newh ()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void __stdcall
|
||||
modify_handle (const char *func, int ln, HANDLE h, const char *name, bool inh)
|
||||
{
|
||||
handle_list *hl = find_handle (h);
|
||||
if (!hl)
|
||||
{
|
||||
system_printf ("%s:%d handle %s<%p> not found", func, ln, name, h);
|
||||
return;
|
||||
}
|
||||
hl->next->inherited = inh;
|
||||
debug_printf ("%s:%d set handle %s<%p> inheritance flag to %d", func, ln,
|
||||
name, h, inh);
|
||||
}
|
||||
|
||||
/* Add a handle to the linked list of known handles. */
|
||||
void __stdcall
|
||||
add_handle (const char *func, int ln, HANDLE h, const char *name, bool inh)
|
||||
|
Reference in New Issue
Block a user