From e33bf4e80a72e2bf207ef120ef2ed153eb5c8aeb Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Thu, 6 Jun 2024 10:42:04 -0400 Subject: [PATCH] Explicitly set sa_flags in sigaction. --- src/main.c | 2 ++ src/queue.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 1b90ce83..3f1eabc4 100644 --- a/src/main.c +++ b/src/main.c @@ -109,6 +109,7 @@ int main(int argc, char *argv[]) act.sa_handler = sigalrm; sigemptyset(&act.sa_mask); + act.sa_flags = SA_RESTART; if (sigaction(SIGALRM, &act, NULL) < 0) { fprintf(stderr, "%s: sigaction() failed: %s\n", argv[0], strerror(errno)); @@ -116,6 +117,7 @@ int main(int argc, char *argv[]) } act.sa_handler = sigxcpu; + act.sa_flags = SA_RESTART; sigemptyset(&act.sa_mask); if (sigaction(SIGXCPU, &act, NULL) < 0) { fprintf(stderr, "%s: sigaction() failed: %s\n", diff --git a/src/queue.c b/src/queue.c index a3f96e55..2f0ebc3c 100644 --- a/src/queue.c +++ b/src/queue.c @@ -359,7 +359,8 @@ void HandleQueuedReminders(void) if (ShouldFork || Daemon) { sa.sa_handler = SigIntHandler; - sa.sa_flags = 0; + sa.sa_flags = SA_RESTART; + sigemptyset(&sa.sa_mask); (void) sigaction(SIGINT, &sa, NULL); sa.sa_handler = SigContHandler; (void) sigaction(SIGCONT, &sa, NULL);