We didn't copy the close-on-exec flags on fork(), thus always leaving

all FDs in a fork()+exec()ed child open. Makes Perl test
t/run/cloexec.t pass.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24336 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-03-09 18:00:17 +00:00
parent 4a7f236b07
commit f542307a98

View File

@ -3792,6 +3792,9 @@ vfs_new_io_context(void *_parentContext)
context->num_used_fds++;
atomic_add(&descriptor->ref_count, 1);
atomic_add(&descriptor->open_count, 1);
if (fd_close_on_exec(parentContext, i))
fd_set_close_on_exec(context, i, true);
}
}