diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 579763d7..983af5e2 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -973,7 +973,7 @@ libwebsocket_service_fd(struct libwebsocket_context *context, /* handle session socket closed */ - if ((!pollfd->revents & POLLIN) && + if ((!(pollfd->revents & POLLIN)) && (pollfd->revents & (POLLERR | POLLHUP))) { lwsl_debug("Session Socket %p (fd=%d) dead\n",