Change 20019 by [EMAIL PROTECTED] on 2003/07/05 18:40:51

        Make a read from a write-only fh to set errno
        (found by Gisle)

Affected files ...

... //depot/perl/perlio.c#227 edit

Differences ...

==== //depot/perl/perlio.c#227 (text) ====
Index: perl/perlio.c
--- perl/perlio.c#226~19749~    Thu Jun 12 06:27:44 2003
+++ perl/perlio.c       Sat Jul  5 11:40:51 2003
@@ -2033,8 +2033,11 @@
 {
     STDCHAR *buf = (STDCHAR *) vbuf;
     if (f) {
-       if (!(PerlIOBase(f)->flags & PERLIO_F_CANREAD))
+        if (!(PerlIOBase(f)->flags & PERLIO_F_CANREAD)) {
+           PerlIOBase(f)->flags |= PERLIO_F_ERROR;
+           SETERRNO(EBADF, SS_IVCHAN);
            return 0;
+       }
        while (count > 0) {
            SSize_t avail = PerlIO_get_cnt(f);
            SSize_t take = 0;
End of Patch.

Reply via email to