From 3af82c6cafd7a20719c7bc03630c111f281306ea Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 19 Jan 2016 07:20:14 -0800 Subject: bugfix: cached sigmask not populated from OS sigmask. This is responsible for behaviors like Ctrl-C being subsequently ignored after the first time a read is interrupted that way. * signal.c (sig_reload_cache): Eliminate the return statement which was making the memcpy expression unreachable! No warning from gcc. Also, since nobody checks the return value of this function and it doesn't provide one, let's make it void. There is no reason the sigprocmask would fail since the arguments are correct, but let's check its return value anyway. --- signal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/signal.c b/signal.c index 2bcf8d72..434bc522 100644 --- a/signal.c +++ b/signal.c @@ -67,11 +67,11 @@ static int is_cpu_exception(int sig) } } -static int sig_reload_cache(void) +static void sig_reload_cache(void) { sigset_t set; - return sigprocmask(SIG_BLOCK, 0, &set); - memcpy(&sig_blocked_cache, &set, sizeof sig_blocked_cache); + if (sigprocmask(SIG_BLOCK, 0, &set) == 0) + memcpy(&sig_blocked_cache, &set, sizeof sig_blocked_cache); } static void sig_handler(int sig) -- cgit v1.2.3