wez Wed Oct 8 06:58:29 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/main streams.c Log: Backport from HEAD; set EOF marker after each read attempt to avoid it being stuck in the on position. Partial "fix" for #25649. Index: php-src/main/streams.c diff -u php-src/main/streams.c:1.125.2.81 php-src/main/streams.c:1.125.2.82 --- php-src/main/streams.c:1.125.2.81 Thu Sep 11 01:07:47 2003 +++ php-src/main/streams.c Wed Oct 8 06:58:28 2003 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streams.c,v 1.125.2.81 2003/09/11 05:07:47 iliaa Exp $ */ +/* $Id: streams.c,v 1.125.2.82 2003/10/08 10:58:28 wez Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -1460,8 +1460,7 @@ if (data->fd >= 0) { ret = read(data->fd, buf, count); - if (ret == 0 || (ret == -1 && errno != EWOULDBLOCK)) - stream->eof = 1; + stream->eof = (ret == 0 || (ret == -1 && errno != EWOULDBLOCK)); } else { #if HAVE_FLUSHIO @@ -1472,8 +1471,7 @@ ret = fread(buf, 1, count, data->file); - if (feof(data->file)) - stream->eof = 1; + stream->eof = feof(data->file); } return ret < 0 ? 0 : ret; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php