From: Jason Greene Date: Wed, 5 Sep 2001 15:30:34 +0000 (+0000) Subject: Prevent incorrect warning message from occuring on an EOF of socket_read. X-Git-Tag: PRE_SUBST_Z_MACROS~217 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54905782b6899f59bffeba0038fd4aa4f360153b;p=php Prevent incorrect warning message from occuring on an EOF of socket_read. --- diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index af4190f0ba..6a1198d148 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -785,8 +785,11 @@ PHP_FUNCTION(socket_read) #endif if (retval <= 0) { - php_error(E_WARNING, "Couldn't read %d bytes from socket %d [%d]: %s", - Z_LVAL_PP(arg2), php_sock->bsd_socket, errno, strerror(errno)); + if (retval != 0) { + /* Not EOF */ + php_error(E_WARNING, "Couldn't read %d bytes from socket %d [%d]: %s", + Z_LVAL_PP(arg2), php_sock->bsd_socket, errno, strerror(errno)); + } efree(tmpbuf); RETURN_FALSE; }