summaryrefslogtreecommitdiffstats
path: root/signal.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-01-19 07:20:14 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-01-19 07:20:14 -0800
commit3af82c6cafd7a20719c7bc03630c111f281306ea (patch)
tree839df643d6c0816eb0db3be3c3b013ef4bad4253 /signal.c
parent991e9f106e8bd4c6263f46a877db4565ebfbfa54 (diff)
downloadtxr-3af82c6cafd7a20719c7bc03630c111f281306ea.tar.gz
txr-3af82c6cafd7a20719c7bc03630c111f281306ea.tar.bz2
txr-3af82c6cafd7a20719c7bc03630c111f281306ea.zip
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.
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c6
1 files 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)