Our close-on-exec flag handling was broken: it's supposed to be specified per slot, not
per file descriptor (a descriptor can be shared among several slots). There is now a second table in the io_context structure that contains that information in a bitmap. There are now two new (private) functions to control the close-on-exec flag, fd_close_on_exec(), and fd_set_close_on_exec(). F_DUPFD, dup(), and dup2() are supposed to clear the close-on-exec flag on the duplicated slot - this fixes bug #57 (no output after a redirect of a shell builtin). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14313 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -37,6 +37,7 @@ typedef struct io_context {
|
||||
uint32 table_size;
|
||||
uint32 num_used_fds;
|
||||
struct file_descriptor **fds;
|
||||
uint8 *fds_close_on_exec;
|
||||
struct list node_monitors;
|
||||
uint32 num_monitors;
|
||||
uint32 max_monitors;
|
||||
|
||||
Reference in New Issue
Block a user