aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--udev-block-notify.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/udev-block-notify.c b/udev-block-notify.c
index 207044f..f029f4f 100644
--- a/udev-block-notify.c
+++ b/udev-block-notify.c
@@ -162,8 +162,10 @@ int main (int argc, char ** argv) {
notifications->notification = NULL;
notifications->next = NULL;
- signal(SIGINT, received_signal);
- signal(SIGTERM, received_signal);
+ struct sigaction act = { 0 };
+ act.sa_handler = received_signal;
+ sigaction(SIGINT, &act, NULL);
+ sigaction(SIGTERM, &act, NULL);
#ifdef HAVE_SYSTEMD
sd_notify(0, "READY=1\nSTATUS=Waiting for udev block events...");