Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2012-01-22 11:27:57 +0400
committerChristopher Faylor <me@cgf.cx>2012-01-22 11:27:57 +0400
commit0646a508aa06cf300214187237714b14cd5d5136 (patch)
tree59a7c784b10b660cfc42ebcb495fb2850ddee3e7 /winsup/cygwin/syscalls.cc
parentad87edbe61a324a67be86eb0d2efafa4d52b4a6f (diff)
* cygheap.h (cygheap_fdmanip::release): Simplify.
* dtable.cc (dtable::release): Make void again. Skip not_open check since it is guaranteed to be open. Don't bother deleting here since actual deletion will be handled in cygheap_fdget::~cygheap_fdget. * dtable.h (dtable::release): Make void again. * syscalls.cc (dup2): Bump fhandler use count on successful dup.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 42c1924f5..350c762b5 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -139,8 +139,8 @@ dup2 (int oldfd, int newfd)
cygheap_fdget cfd (oldfd);
res = (cfd >= 0) ? oldfd : -1;
}
- else
- res = cygheap->fdtab.dup3 (oldfd, newfd, 0);
+ else if ((res = cygheap->fdtab.dup3 (oldfd, newfd, 0)) == newfd)
+ cygheap->fdtab[newfd]->refcnt (1);
syscall_printf ("%R = dup2(%d, %d)", res, oldfd, newfd);
return res;