* dtable.cc (dtable::dup_worker): Add comment explaining why refcnt isn't

incremented here.
(dtable::dup3): Simplify slightly.  Add comment.
* syscalls.cc (dup3): Increment refcnt here, similarly to dup2.
This commit is contained in:
Christopher Faylor
2012-02-01 17:20:02 +00:00
parent 4c68bf65c8
commit 8fa8b3a389
3 changed files with 17 additions and 5 deletions

View File

@@ -161,8 +161,9 @@ dup3 (int oldfd, int newfd, int flags)
set_errno (cfd < 0 ? EBADF : EINVAL);
res = -1;
}
else
res = cygheap->fdtab.dup3 (oldfd, newfd, flags);
else if ((res = cygheap->fdtab.dup3 (oldfd, newfd, flags)) == newfd)
cygheap->fdtab[newfd]->refcnt (1);
syscall_printf ("%R = dup3(%d, %d, %p)", res, oldfd, newfd, flags);
return res;
}