summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-07-18 02:16:40 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-07-18 02:16:40 +0000
commit5c7a8c7888175e16e13670318410610dcb21c26f (patch)
treef0bc31274bb0036f66a07472161997938809ed2b /pp_sys.c
parentb0a484d2bfe866f41e22a982ca9f2013ae9c3848 (diff)
downloadperl-5c7a8c7888175e16e13670318410610dcb21c26f.tar.gz
check ferror() only if read() returned 0
p4raw-id: //depot/perl@1527
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index fe75220d38..f8807197a7 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1329,7 +1329,7 @@ PP(pp_sysread)
{
length = PerlIO_read(IoIFP(io), buffer+offset, length);
/* fread() returns 0 on both error and EOF */
- if (PerlIO_error(IoIFP(io)))
+ if (length == 0 && PerlIO_error(IoIFP(io)))
length = -1;
}
if (length < 0)