diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-05 22:47:57 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-05 22:47:57 +0000 |
commit | 3b02c43c0619d70d7a120dfd99bbe8770f0ea6ca (patch) | |
tree | 2e86a0885cf6a68e235a05c278ed48ab502d78d6 /pp_sys.c | |
parent | 0ce625782f64de805c21893bca308710ed297c68 (diff) | |
download | perl-3b02c43c0619d70d7a120dfd99bbe8770f0ea6ca.tar.gz |
make read() return undef on errors as documented, and clarify docs
p4raw-id: //depot/perl@1328
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1324,7 +1324,12 @@ PP(pp_sysread) } else #endif + { length = PerlIO_read(IoIFP(io), buffer+offset, length); + /* fread() returns 0 on both error and EOF */ + if (PerlIO_error(IoIFP(io))) + length = -1; + } if (length < 0) goto say_undef; SvCUR_set(bufsv, length+offset); |