summaryrefslogtreecommitdiffstats
path: root/signal.c
diff options
context:
space:
mode:
authornicm <nicm>2015-10-27 13:23:24 +0000
committernicm <nicm>2015-10-27 13:23:24 +0000
commit07b0ea03c33893bd2b104db5ea4e1397f92e0477 (patch)
treec24ffdc1db106d5b81ce943c0567f186484ef5eb /signal.c
parent9952201ca72b42819d64a9174fa7b5b898215668 (diff)
Break the common process set up, event loop and imsg dispatch code
between server and client out into a separate internal API. This will make it easier to add another process.
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/signal.c b/signal.c
index 7e6268a7..9a4d58c2 100644
--- a/signal.c
+++ b/signal.c
@@ -32,7 +32,7 @@ struct event ev_sigusr1;
struct event ev_sigwinch;
void
-set_signals(void(*handler)(int, short, unused void *))
+set_signals(void (*handler)(int, short, void *), void *arg)
{
struct sigaction sigact;
@@ -49,17 +49,17 @@ set_signals(void(*handler)(int, short, unused void *))
if (sigaction(SIGTSTP, &sigact, NULL) != 0)
fatal("sigaction failed");
- signal_set(&ev_sighup, SIGHUP, handler, NULL);
+ signal_set(&ev_sighup, SIGHUP, handler, arg);
signal_add(&ev_sighup, NULL);
- signal_set(&ev_sigchld, SIGCHLD, handler, NULL);
+ signal_set(&ev_sigchld, SIGCHLD, handler, arg);
signal_add(&ev_sigchld, NULL);
- signal_set(&ev_sigcont, SIGCONT, handler, NULL);
+ signal_set(&ev_sigcont, SIGCONT, handler, arg);
signal_add(&ev_sigcont, NULL);
- signal_set(&ev_sigterm, SIGTERM, handler, NULL);
+ signal_set(&ev_sigterm, SIGTERM, handler, arg);
signal_add(&ev_sigterm, NULL);
- signal_set(&ev_sigusr1, SIGUSR1, handler, NULL);
+ signal_set(&ev_sigusr1, SIGUSR1, handler, arg);
signal_add(&ev_sigusr1, NULL);
- signal_set(&ev_sigwinch, SIGWINCH, handler, NULL);
+ signal_set(&ev_sigwinch, SIGWINCH, handler, arg);
signal_add(&ev_sigwinch, NULL);
}