From 5c7a8c7888175e16e13670318410610dcb21c26f Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Sat, 18 Jul 1998 02:16:40 +0000 Subject: check ferror() only if read() returned 0 p4raw-id: //depot/perl@1527 --- pp_sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pp_sys.c') 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) -- cgit v1.2.1