aboutsummaryrefslogtreecommitdiffstats
path: root/src/signals.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-03-06 09:55:27 +0100
committerMattias Andrée <m@maandree.se>2025-03-06 09:55:27 +0100
commit4ff6090dfb9c947e894a7c1d0474b8d8d8f9031a (patch)
tree6c137a20f95f0be71d11940c6acb77e11aee6377 /src/signals.c
parentFix warning (diff)
downloadredshift-ng-4ff6090dfb9c947e894a7c1d0474b8d8d8f9031a.tar.gz
redshift-ng-4ff6090dfb9c947e894a7c1d0474b8d8d8f9031a.tar.bz2
redshift-ng-4ff6090dfb9c947e894a7c1d0474b8d8d8f9031a.tar.xz
Style
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'src/signals.c')
-rw-r--r--src/signals.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/signals.c b/src/signals.c
index a502be9..492c90d 100644
--- a/src/signals.c
+++ b/src/signals.c
@@ -57,46 +57,37 @@ signals_install_handlers(void)
struct sigaction sigact;
sigset_t sigset;
- /* Install signal handler for INT and TERM signals */
memset(&sigact, 0, sizeof(sigact));
sigemptyset(&sigset);
- sigact.sa_handler = sigexit;
sigact.sa_mask = sigset;
sigact.sa_flags = 0;
+ /* Install signal handler for INT, TERM, QUIT signals */
+ sigact.sa_handler = sigexit;
if (sigaction(SIGINT, &sigact, NULL)) {
- perror("sigaction");
+ weprintf("sigaction SIGINT &{.sa_handler=<function pointer>, .sa_mask={}, .sa_flags=0} NULL:");
return -1;
}
-
if (sigaction(SIGTERM, &sigact, NULL)) {
- perror("sigaction");
+ weprintf("sigaction SIGTERM &{.sa_handler=<function pointer>, .sa_mask={}, .sa_flags=0} NULL:");
return -1;
}
-
if (sigaction(SIGQUIT, &sigact, NULL)) {
- perror("sigaction");
+ weprintf("sigaction SIGQUIT &{.sa_handler=<function pointer>, .sa_mask={}, .sa_flags=0} NULL:");
return -1;
}
/* Install signal handler for USR1 signal */
sigact.sa_handler = sigdisable;
- sigact.sa_mask = sigset;
- sigact.sa_flags = 0;
-
if (sigaction(SIGUSR1, &sigact, NULL)) {
- perror("sigaction");
+ weprintf("sigaction SIGUSR1 &{.sa_handler=<function pointer>, .sa_mask={}, .sa_flags=0} NULL:");
return -1;
}
- /* Ignore CHLD signal. This causes child processes
- (hooks) to be reaped automatically. */
+ /* Ignore CHLD signal. This causes child processes (hooks) to be reaped automatically. */
sigact.sa_handler = SIG_IGN;
- sigact.sa_mask = sigset;
- sigact.sa_flags = 0;
-
if (sigaction(SIGCHLD, &sigact, NULL)) {
- perror("sigaction");
+ weprintf("sigaction SIGCHLD &{.sa_handler=SIG_IGN, .sa_mask={}, .sa_flags=0} NULL:");
return -1;
}
#endif