* 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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user