Add a warning comment to "poller_fd::closed"
This commit is contained in:
parent
9866675bb7
commit
22edb6d489
|
@ -1460,6 +1460,7 @@ mpd_client_reset (struct mpd_client *self)
|
|||
xclose (self->socket);
|
||||
self->socket = -1;
|
||||
|
||||
// FIXME: this is not robust wrt. forking
|
||||
self->socket_event.closed = true;
|
||||
poller_fd_reset (&self->socket_event);
|
||||
poller_timer_reset (&self->timeout_timer);
|
||||
|
|
|
@ -1326,6 +1326,9 @@ struct poller_fd
|
|||
|
||||
int fd; ///< Our file descriptor
|
||||
short events; ///< The poll() events we registered for
|
||||
|
||||
// Make triple sure that no forked child is keeping the FD,
|
||||
// otherwise we may access freed memory on Linux (poor epoll design)
|
||||
bool closed; ///< Whether fd has been closed already
|
||||
|
||||
poller_fd_fn dispatcher; ///< Event dispatcher
|
||||
|
|
Loading…
Reference in New Issue