summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sighook.c2
-rw-r--r--tests/sighook.c7
2 files changed, 9 insertions, 0 deletions
diff --git a/src/sighook.c b/src/sighook.c
index 4356fdb..0cc81fa 100644
--- a/src/sighook.c
+++ b/src/sighook.c
@@ -291,6 +291,8 @@ static void sigpop(struct siglist *list, struct sighook *hook) {
rcu_update(hook->self, next);
if (next) {
next->self = hook->self;
+ } else {
+ list->tail = &list->head;
}
}
diff --git a/tests/sighook.c b/tests/sighook.c
index d785a55..0cb8de2 100644
--- a/tests/sighook.c
+++ b/tests/sighook.c
@@ -60,6 +60,13 @@ void check_sighook(void) {
return;
}
+ // Check that we can unregister and re-register a hook
+ sigunhook(hook);
+ hook = sighook(SIGALRM, alrm_hook, NULL, SH_CONTINUE);
+ if (!bfs_echeck(hook, "sighook(SIGALRM)")) {
+ return;
+ }
+
// Create a timer that sends SIGALRM every 100 microseconds
struct timespec ival = { .tv_nsec = 100 * 1000 };
struct timer *timer = xtimer_start(&ival);