Don't remove invalid socket from epoll fd.

pull/683/head
Roger A. Light 8 years ago
parent 2283585e39
commit 027c5d7f6e

@ -613,7 +613,7 @@ void do_disconnect(struct mosquitto_db *db, struct mosquitto *context)
}
}
#ifdef WITH_EPOLL
if (epoll_ctl(db->epollfd, EPOLL_CTL_DEL, context->sock, &ev) == -1) {
if (context->sock != INVALID_SOCKET && epoll_ctl(db->epollfd, EPOLL_CTL_DEL, context->sock, &ev) == -1) {
log__printf(NULL, MOSQ_LOG_DEBUG, "Error in epoll disconnecting: %s", strerror(errno));
}
#endif

Loading…
Cancel
Save