From: Nick Ing-Simmons Date: Sat, 24 May 2003 14:53:02 +0000 (+0000) Subject: re-instate warning with syslayer abstraction. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bdbaa24fbcf4fe3d4c7457bb2cbc64f35a786d30;p=p5sagit%2Fp5-mst-13.2.git re-instate warning with syslayer abstraction. p4raw-id: //depot/perlio@19615 --- diff --git a/perlio.c b/perlio.c index 2e11ab6..9530663 100644 --- a/perlio.c +++ b/perlio.c @@ -2493,8 +2493,12 @@ SSize_t PerlIOUnix_read(pTHX_ PerlIO *f, void *vbuf, Size_t count) { int fd = PerlIOSelf(f, PerlIOUnix)->fd; - if (!(PerlIOBase(f)->flags & PERLIO_F_CANREAD) || - PerlIOBase(f)->flags & (PERLIO_F_EOF|PERLIO_F_ERROR)) { + if (!(PerlIOBase(f)->flags & PERLIO_F_CANREAD)) { + SETERRNO(EBADF, SS_IVCHAN); + PerlIOBase(f)->flags |= PERLIO_F_ERROR; + return -1; + } + if (PerlIOBase(f)->flags & (PERLIO_F_EOF|PERLIO_F_ERROR)) { return 0; } while (1) {