* dtable.cc (dtable::dup2): Add some debugging. Use methods from passed in

class rather than cygheap->fdtab.
* fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Add more
debugging output.
(fhandler_socket::dup): Allocate new space for prot_info_ptr for duplicated
entry.
* syscalls.cc (stat_worker): Always delete fh if it has been created.
This commit is contained in:
Christopher Faylor
2001-10-30 07:43:46 +00:00
parent 3d4b75dec2
commit 19ba6f2195
4 changed files with 27 additions and 13 deletions

View File

@@ -383,6 +383,7 @@ dtable::dup2 (int oldfd, int newfd)
goto done;
}
debug_printf ("newfh->io_handle %p, oldfh->io_handle %p", newfh->get_io_handle (), fds[oldfd]->get_io_handle ());
SetResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "dup");
if (newfd < 0)
@@ -392,11 +393,11 @@ dtable::dup2 (int oldfd, int newfd)
goto done;
}
if ((size_t) newfd >= cygheap->fdtab.size)
if ((size_t) newfd >= size)
{
int inc_size = NOFILE_INCR * ((newfd + NOFILE_INCR - 1) / NOFILE_INCR) -
cygheap->fdtab.size;
cygheap->fdtab.extend (inc_size);
size;
extend (inc_size);
}
if (!not_open (newfd))