From d6b7fe0e3b02bae7f8ca73706522755bb35ae699 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 9 Nov 2012 03:21:00 +0100 Subject: [PATCH] unix: squelch -Wunused-but-set-variable warnings --- src/unix/signal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unix/signal.c b/src/unix/signal.c index 45555b52..c24bb783 100644 --- a/src/unix/signal.c +++ b/src/unix/signal.c @@ -189,17 +189,16 @@ static uv_err_t uv__signal_register_handler(int signum) { static void uv__signal_unregister_handler(int signum) { /* When this function is called, the signal lock must be held. */ struct sigaction sa; - int r; memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_DFL; - r = sigaction(signum, &sa, NULL); /* sigaction can only fail with EINVAL or EFAULT; an attempt to deregister a * signal implies that it was successfully registered earlier, so EINVAL * should never happen. */ - assert(r == 0); + if (sigaction(signum, &sa, NULL)) + abort(); } @@ -439,6 +438,7 @@ static void uv__signal_stop(uv_signal_t* handle) { removed_handle = RB_REMOVE(uv__signal_tree_s, &uv__signal_tree, handle); assert(removed_handle == handle); + (void) removed_handle; /* Check if there are other active signal watchers observing this signal. If * not, unregister the signal handler.