From 6d33c56d0f11d124ec112fc4480ad155a4d9ce52 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Tue, 4 Sep 2018 07:16:01 +0200 Subject: [PATCH] Return early and OK if signal watcher is already stopped Signed-off-by: Joachim Nilsson --- src/signal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/signal.c b/src/signal.c index 3e30a24..085f350 100644 --- a/src/signal.c +++ b/src/signal.c @@ -140,6 +140,9 @@ int uev_signal_start(uev_t *w) */ int uev_signal_stop(uev_t *w) { + if (!_uev_watcher_active(w)) + return 0; + if (_uev_watcher_stop(w)) return -1;