re-instate warning with syslayer abstraction.
Nick Ing-Simmons [Sat, 24 May 2003 14:53:02 +0000 (14:53 +0000)]
p4raw-id: //depot/perlio@19615

perlio.c

index 2e11ab6..9530663 100644 (file)
--- 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) {