Cygwin: pipe, fifo: Call set_no_inheritance() for adjunct handles.
- Currntly, set_no_inheritance() is not called for the adjunct handles such as select_sem. This patch fixes the issue.
This commit is contained in:
parent
3e80b12fde
commit
0d12015670
|
@ -1208,6 +1208,7 @@ public:
|
||||||
void open_setup (int flags);
|
void open_setup (int flags);
|
||||||
void fixup_after_fork (HANDLE);
|
void fixup_after_fork (HANDLE);
|
||||||
int dup (fhandler_base *child, int);
|
int dup (fhandler_base *child, int);
|
||||||
|
void set_close_on_exec (bool val);
|
||||||
int close ();
|
int close ();
|
||||||
void __reg3 raw_read (void *ptr, size_t& len);
|
void __reg3 raw_read (void *ptr, size_t& len);
|
||||||
int ioctl (unsigned int cmd, void *);
|
int ioctl (unsigned int cmd, void *);
|
||||||
|
|
|
@ -1817,4 +1817,6 @@ fhandler_fifo::set_close_on_exec (bool val)
|
||||||
set_no_inheritance (fc_handler[i].h, val);
|
set_no_inheritance (fc_handler[i].h, val);
|
||||||
fifo_client_unlock ();
|
fifo_client_unlock ();
|
||||||
}
|
}
|
||||||
|
if (select_sem)
|
||||||
|
set_no_inheritance (select_sem, val);
|
||||||
}
|
}
|
||||||
|
|
|
@ -515,6 +515,16 @@ fhandler_pipe_fifo::raw_write (const void *ptr, size_t len)
|
||||||
return nbytes ?: -1;
|
return nbytes ?: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fhandler_pipe::set_close_on_exec (bool val)
|
||||||
|
{
|
||||||
|
fhandler_base::set_close_on_exec (val);
|
||||||
|
if (read_mtx)
|
||||||
|
set_no_inheritance (read_mtx, val);
|
||||||
|
if (select_sem)
|
||||||
|
set_no_inheritance (select_sem, val);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fhandler_pipe::fixup_after_fork (HANDLE parent)
|
fhandler_pipe::fixup_after_fork (HANDLE parent)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue