From d8274c2c9cfd3d5e534902e9e5c7d395c706ce24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 28 Dec 2018 14:08:45 +0100 Subject: [PATCH] module/mpd: refresh thread only resets refresh_abort_fd if it's "ours" That is, we only reset it if the module main thread haven't already done so (and quite possibly created another eventfd). --- modules/mpd/mpd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/mpd/mpd.c b/modules/mpd/mpd.c index 6ef356c..db2126d 100644 --- a/modules/mpd/mpd.c +++ b/modules/mpd/mpd.c @@ -350,7 +350,8 @@ refresh_in_thread(void *arg) /* Close abort eventfd */ mtx_lock(&mod->lock); close(abort_fd); - m->refresh_abort_fd = 0; + if (m->refresh_abort_fd == abort_fd) + m->refresh_abort_fd = -1; mtx_unlock(&mod->lock); /* Aborted? */