]> granicus.if.org Git - php/commitdiff
Prevent incorrect warning message from occuring on an EOF of socket_read.
authorJason Greene <jason@php.net>
Wed, 5 Sep 2001 15:30:34 +0000 (15:30 +0000)
committerJason Greene <jason@php.net>
Wed, 5 Sep 2001 15:30:34 +0000 (15:30 +0000)
ext/sockets/sockets.c

index af4190f0bafa572cf02bfc1f3f430eac87d95aa9..6a1198d1489c8626033910dc840a9766c331548f 100644 (file)
@@ -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;
        }