From e62ac9e86925090d0727605b33a1628d01b86158 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 1 Sep 2001 05:17:34 +0000 Subject: * debug.cc (mark_closed): Rename from debug_mark_closed and make static. (setclexec_pid): New function for marking saved handle as close-on-exec. (delete_handle): New function. (debug_fixup_after_fork): New function. * debug.h: Declare new functions, remove obsolete ones. * fork.cc (debug_fixup_after_fork): Call to cleanup close-on-exec handles. * fhandler.cc (fhandler_disk_file::close): Minor reorg. (fhandler_base::set_inheritance): Set flag appropriately for debugging when close-on-exec so forked process can delete closed handles. * tty.h (open_output_mutex): Eliminate unneeded argument. (open_input_mutex): Ditto. * fhandler_tty.cc (fhandler_tty_slave::open): reflect open_*_mutex argument changes. * fhandler.h (fhandler_socket): Make saw_shutdown_* functions type bool. * tty.cc (tty::get_event): Eliminate unneeded argument. (tty::common_init): Reflect change to get_event. Events should always be inherited. --- winsup/cygwin/fhandler.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/fhandler.cc') diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 86c6b4df6..4060a3819 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -785,7 +785,7 @@ fhandler_base::lseek (off_t offset, int whence) } int -fhandler_base::close (void) +fhandler_base::close () { int res = -1; @@ -1317,8 +1317,8 @@ out: int fhandler_disk_file::close () { - int res; - if ((res = this->fhandler_base::close ()) == 0) + int res = this->fhandler_base::close (); + if (!res) cygwin_shared->delqueue.process_queue (); return res; } @@ -1545,6 +1545,7 @@ fhandler_base::set_inheritance (HANDLE &h, int not_inheriting, const char *namep h = newh; ProtectHandle2 (h, name); } + setclexec_pid (h, not_inheriting); #endif } -- cgit v1.2.3