diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c index 7a29844ab4..cdfdc5ef37 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -1231,8 +1231,9 @@ static esl_ssize_t handle_recv(esl_handle_t *handle, void *data, esl_size_t data if ((activity & ESL_POLL_ERROR)) { activity = -1; } else if ((activity & ESL_POLL_READ)) { - activity = recv(handle->sock, data, datalen, 0); - if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) { + if (!(activity = recv(handle->sock, data, datalen, 0))) { + activity = -1; + } else if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) { activity = 0; } }