* fhandler.h class fhandler_socket): Declare new method

`set_close_on_exec'.
        * fhandler_socket.cc (fhandler_socket::set_close_on_exec):
        New method.
This commit is contained in:
Corinna Vinschen 2001-06-22 20:53:45 +00:00
parent 3b295174e3
commit 50b1264871
3 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,10 @@
Fri Jun 22 16:50:00 2001 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h class fhandler_socket): Declare new method
`set_close_on_exec'.
* fhandler_socket.cc (fhandler_socket::set_close_on_exec):
New method.
Fri Jun 22 16:12:00 2001 Corinna Vinschen <corinna@vinschen.de>
* fhandler_tape.cc (fhandler_dev_tape::tape_erase): Set size

View File

@ -383,6 +383,7 @@ public:
void hclose (HANDLE) {close ();}
int dup (fhandler_base *child);
void set_close_on_exec (int val);
virtual void fixup_before_fork_exec (DWORD);
void fixup_after_fork (HANDLE);
void fixup_after_exec (HANDLE parent) { fixup_after_fork (parent); }

View File

@ -431,3 +431,12 @@ fhandler_socket::fcntl (int cmd, void *arg)
return res;
}
void
fhandler_socket::set_close_on_exec (int val)
{
extern WSADATA wsadata;
if (wsadata.wVersion < 512) /* < Winsock 2.0 */
set_inheritance (get_handle (), val);
set_close_on_exec_flag (val);
debug_printf ("set close_on_exec for %s to %d", get_name (), val);
}