summaryrefslogtreecommitdiff
path: root/ext/sockets/sockets.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/sockets/sockets.c')
-rw-r--r--ext/sockets/sockets.c7
1 files changed, 5 insertions, 2 deletions
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;
}