mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 12:28:19 -04:00
Avoid a spurious close(-1) on Linux
On Linux, we use only one fd to do main-thread signaling (since we have eventfd()), so we don't need to close th_notify_fd[1] as we would if we were using a socketpair.
This commit is contained in:
parent
75018951ec
commit
70a44b61bb
3
event.c
3
event.c
@ -648,7 +648,8 @@ event_base_free(struct event_base *base)
|
|||||||
if (base->th_notify_fd[0] != -1) {
|
if (base->th_notify_fd[0] != -1) {
|
||||||
event_del(&base->th_notify);
|
event_del(&base->th_notify);
|
||||||
EVUTIL_CLOSESOCKET(base->th_notify_fd[0]);
|
EVUTIL_CLOSESOCKET(base->th_notify_fd[0]);
|
||||||
EVUTIL_CLOSESOCKET(base->th_notify_fd[1]);
|
if (base->th_notify_fd[1] != -1)
|
||||||
|
EVUTIL_CLOSESOCKET(base->th_notify_fd[1]);
|
||||||
base->th_notify_fd[0] = -1;
|
base->th_notify_fd[0] = -1;
|
||||||
base->th_notify_fd[1] = -1;
|
base->th_notify_fd[1] = -1;
|
||||||
event_debug_unassign(&base->th_notify);
|
event_debug_unassign(&base->th_notify);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user