0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-31 01:43:02 +08:00

Problem: IPC event_closed logs -1 as the FD

Solution: take a copy of the file descriptor before setting it to
retired_fd.
This commit is contained in:
Luca Boccassi 2017-10-06 09:53:59 +01:00
parent 9be8cebd21
commit 7ad06f1449

View File

@ -289,6 +289,7 @@ error:
int zmq::ipc_listener_t::close ()
{
zmq_assert (s != retired_fd);
int fd_for_event = s;
int rc = ::close (s);
errno_assert (rc == 0);
@ -308,7 +309,7 @@ int zmq::ipc_listener_t::close ()
}
}
socket->event_closed (endpoint, s);
socket->event_closed (endpoint, fd_for_event);
return 0;
}