* 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:
Christopher Faylor
2006-05-25 05:40:51 +00:00
parent 38229bcdcf
commit 3cd94e0c0a
6 changed files with 50 additions and 8 deletions

View File

@ -252,7 +252,7 @@ class fhandler_base
virtual void set_no_inheritance (HANDLE &h, int not_inheriting);
/* fixup fd possibly non-inherited handles after fork */
void fork_fixup (HANDLE parent, HANDLE &h, const char *name);
bool fork_fixup (HANDLE parent, HANDLE &h, const char *name);
virtual bool need_fixup_before () const {return false;}
int open_9x (int flags, mode_t mode = 0);