mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-08 14:56:14 +01:00
Always mark socket as retired when closing ipc_listener
When closing an ipc listener, the library may try to unlink the associated file. When this fails, the underlying socket is not marked as retired and this triggers assertion failure. Fixes issue #397
This commit is contained in:
@@ -171,6 +171,8 @@ int zmq::ipc_listener_t::close ()
|
|||||||
int rc = ::close (s);
|
int rc = ::close (s);
|
||||||
errno_assert (rc == 0);
|
errno_assert (rc == 0);
|
||||||
|
|
||||||
|
s = retired_fd;
|
||||||
|
|
||||||
// If there's an underlying UNIX domain socket, get rid of the file it
|
// If there's an underlying UNIX domain socket, get rid of the file it
|
||||||
// is associated with.
|
// is associated with.
|
||||||
if (has_file && !filename.empty ()) {
|
if (has_file && !filename.empty ()) {
|
||||||
@@ -182,7 +184,6 @@ int zmq::ipc_listener_t::close ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
socket->monitor_event (ZMQ_EVENT_CLOSED, endpoint.c_str(), s);
|
socket->monitor_event (ZMQ_EVENT_CLOSED, endpoint.c_str(), s);
|
||||||
s = retired_fd;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user