* cygheap.h (cygheap_fdmanip::isopen): Set appropriate errno if fd not open.

* select.cc (fhandler_base::ready_for_read): Release an open guard mutex when
exiting with an error condition.
* syscalls.cc (_read): Check frequently for closed fd as a kludge until
something better is invented.
This commit is contained in:
Christopher Faylor
2001-11-01 23:48:34 +00:00
parent 1229d4f4ee
commit 53f0029081
4 changed files with 29 additions and 2 deletions

View File

@@ -198,7 +198,13 @@ class cygheap_fdmanip
operator fhandler_base* &() {return *fh;}
void operator = (fhandler_base *fh) {*this->fh = fh;}
fhandler_base *operator -> () const {return *fh;}
bool isopen () const {return *fh;}
bool isopen () const
{
if (*fh)
return true;
set_errno (EBADF);
return false;
}
};
class cygheap_fdnew : public cygheap_fdmanip