From 53f00290819bd294d31d12bb93e8e5e887ad3aef Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 1 Nov 2001 23:48:34 +0000 Subject: * 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. --- winsup/cygwin/cygheap.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/cygheap.h') diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index 5b86804..27196db 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -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 -- cgit v1.1