Fix read from STDERR on raw unix layer for Solaris where fd 2 is
Nick Ing-Simmons [Sun, 5 Nov 2000 11:09:34 +0000 (11:09 +0000)]
open RDWR so does not fail. (pragma/warnings 303 again...)

p4raw-id: //depot/perlio@7555

perlio.c

index 9774c3c..c72818b 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -909,6 +909,8 @@ SSize_t
 PerlIOUnix_read(PerlIO *f, void *vbuf, Size_t count)
 {
  int fd = PerlIOSelf(f,PerlIOUnix)->fd;
+ if (!(PerlIOBase(f)->flags & PERLIO_F_CANREAD))
+  return 0;
  while (1)
   {
    SSize_t len = read(fd,vbuf,count);