* 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.
This commit is contained in:
@@ -237,26 +237,13 @@ dtable::find_unused_handle (int start)
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
dtable::release (int fd)
|
||||
{
|
||||
bool deleted;
|
||||
if (not_open (fd))
|
||||
deleted = false;
|
||||
else
|
||||
{
|
||||
if (fds[fd]->need_fixup_before ())
|
||||
dec_need_fixup_before ();
|
||||
if (fds[fd]->refcnt (-1) > 0)
|
||||
deleted = false;
|
||||
else
|
||||
{
|
||||
deleted = true;
|
||||
delete fds[fd];
|
||||
}
|
||||
fds[fd] = NULL;
|
||||
}
|
||||
return deleted;
|
||||
if (fds[fd]->need_fixup_before ())
|
||||
dec_need_fixup_before ();
|
||||
fds[fd]->refcnt (-1);
|
||||
fds[fd] = NULL;
|
||||
}
|
||||
|
||||
extern "C" int
|
||||
|
Reference in New Issue
Block a user