Skip to content

Commit

Permalink
Prevent incorrect warning message from occuring on an EOF of socket_r…
Browse files Browse the repository at this point in the history
…ead.
  • Loading branch information
Jason Greene committed Sep 5, 2001
1 parent 91606e5 commit 5490578
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ext/sockets/sockets.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5490578

Please sign in to comment.