* dtable.cc (dtable::fixup_after_exec): Use variable rather than constantly
indexing into fds array. (dtable::fixup_after_fork): Ditto.
This commit is contained in:
parent
2f7356f39b
commit
2e78b61dca
|
@ -1,3 +1,9 @@
|
|||
Wed Oct 25 09:59:14 2000 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* dtable.cc (dtable::fixup_after_exec): Use variable rather than
|
||||
constantly indexing into fds array.
|
||||
(dtable::fixup_after_fork): Ditto.
|
||||
|
||||
Wed Oct 25 10:43:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* fhandler.cc (fhandler_base::fcntl): Treat O_NONBLOCK and OLD_O_NDELAY
|
||||
|
|
|
@ -449,19 +449,20 @@ dtable::fixup_after_exec (HANDLE parent, size_t sz, fhandler_base **f)
|
|||
size = sz;
|
||||
fds = f;
|
||||
first_fd_for_open = 0;
|
||||
fhandler_base *fh;
|
||||
for (size_t i = 0; i < size; i++)
|
||||
if (fds[i])
|
||||
if ((fh = fds[i]) != NULL)
|
||||
{
|
||||
fds[i]->clear_readahead ();
|
||||
if (fds[i]->get_close_on_exec ())
|
||||
fh->clear_readahead ();
|
||||
if (fh->get_close_on_exec ())
|
||||
release (i);
|
||||
else
|
||||
{
|
||||
fds[i]->fixup_after_exec (parent);
|
||||
fh->fixup_after_exec (parent);
|
||||
if (i == 0)
|
||||
SetStdHandle (std_consts[i], fds[i]->get_io_handle ());
|
||||
SetStdHandle (std_consts[i], fh->get_io_handle ());
|
||||
else if (i <= 2)
|
||||
SetStdHandle (std_consts[i], fds[i]->get_output_handle ());
|
||||
SetStdHandle (std_consts[i], fh->get_output_handle ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -474,7 +475,7 @@ dtable::fixup_after_fork (HANDLE parent)
|
|||
for (size_t i = 0; i < size; i++)
|
||||
if ((fh = fds[i]) != NULL)
|
||||
{
|
||||
if (fds[i]->get_close_on_exec () || fh->get_need_fork_fixup ())
|
||||
if (fh->get_close_on_exec () || fh->get_need_fork_fixup ())
|
||||
{
|
||||
debug_printf ("fd %d(%s)", i, fh->get_name ());
|
||||
fh->fixup_after_fork (parent);
|
||||
|
|
Loading…
Reference in New Issue