Explicitly set sa_flags in sigaction.

This commit is contained in:
Dianne Skoll
2024-06-06 10:42:04 -04:00
parent b3af44d212
commit e33bf4e80a
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -109,6 +109,7 @@ int main(int argc, char *argv[])
act.sa_handler = sigalrm; act.sa_handler = sigalrm;
sigemptyset(&act.sa_mask); sigemptyset(&act.sa_mask);
act.sa_flags = SA_RESTART;
if (sigaction(SIGALRM, &act, NULL) < 0) { if (sigaction(SIGALRM, &act, NULL) < 0) {
fprintf(stderr, "%s: sigaction() failed: %s\n", fprintf(stderr, "%s: sigaction() failed: %s\n",
argv[0], strerror(errno)); argv[0], strerror(errno));
@@ -116,6 +117,7 @@ int main(int argc, char *argv[])
} }
act.sa_handler = sigxcpu; act.sa_handler = sigxcpu;
act.sa_flags = SA_RESTART;
sigemptyset(&act.sa_mask); sigemptyset(&act.sa_mask);
if (sigaction(SIGXCPU, &act, NULL) < 0) { if (sigaction(SIGXCPU, &act, NULL) < 0) {
fprintf(stderr, "%s: sigaction() failed: %s\n", fprintf(stderr, "%s: sigaction() failed: %s\n",
+2 -1
View File
@@ -359,7 +359,8 @@ void HandleQueuedReminders(void)
if (ShouldFork || Daemon) { if (ShouldFork || Daemon) {
sa.sa_handler = SigIntHandler; sa.sa_handler = SigIntHandler;
sa.sa_flags = 0; sa.sa_flags = SA_RESTART;
sigemptyset(&sa.sa_mask);
(void) sigaction(SIGINT, &sa, NULL); (void) sigaction(SIGINT, &sa, NULL);
sa.sa_handler = SigContHandler; sa.sa_handler = SigContHandler;
(void) sigaction(SIGCONT, &sa, NULL); (void) sigaction(SIGCONT, &sa, NULL);