diff options
author | Jason Greene <jason@php.net> | 2001-09-05 15:30:34 +0000 |
---|---|---|
committer | Jason Greene <jason@php.net> | 2001-09-05 15:30:34 +0000 |
commit | 54905782b6899f59bffeba0038fd4aa4f360153b (patch) | |
tree | bc315b797f192f0c8f68c43b2c30ffedcd895ab1 /ext/sockets/sockets.c | |
parent | 91606e52649c71cb77ca1680fb59c1bc4a8b25b2 (diff) | |
download | php-git-54905782b6899f59bffeba0038fd4aa4f360153b.tar.gz |
Prevent incorrect warning message from occuring on an EOF of socket_read.
Diffstat (limited to 'ext/sockets/sockets.c')
-rw-r--r-- | ext/sockets/sockets.c | 7 |
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; } |