summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dtable.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-10-30 07:43:46 +0000
committerChristopher Faylor <me@cgf.cx>2001-10-30 07:43:46 +0000
commit19ba6f2195b2e7f87cd1aac75cd28335ca94b1ff (patch)
tree65f4127aacd974bb288911454525e4df6c0f0a0a /winsup/cygwin/dtable.cc
parent3d4b75dec24fcf96a3047e8c75cc0f092fe7300f (diff)
downloadcygnal-19ba6f2195b2e7f87cd1aac75cd28335ca94b1ff.tar.gz
cygnal-19ba6f2195b2e7f87cd1aac75cd28335ca94b1ff.tar.bz2
cygnal-19ba6f2195b2e7f87cd1aac75cd28335ca94b1ff.zip
* 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.
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index f82be14a2..4a14712a3 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -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))