diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2010-05-03 16:06:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2010-05-03 16:06:32 +0000 |
commit | ec1d37b1b259e8a3502646876b60eb42c2c5c740 (patch) | |
tree | 9e4df0d9a264623b5c1be85e21fcdf07cbb440b9 /client.c | |
parent | c9191394332342a570dc6620bc8cfd7c6e554e1b (diff) | |
download | rtmux-ec1d37b1b259e8a3502646876b60eb42c2c5c740.tar.gz rtmux-ec1d37b1b259e8a3502646876b60eb42c2c5c740.tar.bz2 rtmux-ec1d37b1b259e8a3502646876b60eb42c2c5c740.zip |
Make signal handler setup/teardown two common functions instead of six,
and reset SIGCHLD after fork to fix problems with some shells. From
Romain Francois.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 25 |
1 files changed, 1 insertions, 24 deletions
@@ -172,35 +172,12 @@ client_update_event(void) __dead void client_main(void) { - struct event ev_sigcont, ev_sigterm, ev_sigwinch; - struct sigaction sigact; - logfile("client"); /* Note: event_init() has already been called. */ /* Set up signals. */ - memset(&sigact, 0, sizeof sigact); - sigemptyset(&sigact.sa_mask); - sigact.sa_flags = SA_RESTART; - sigact.sa_handler = SIG_IGN; - if (sigaction(SIGINT, &sigact, NULL) != 0) - fatal("sigaction failed"); - if (sigaction(SIGPIPE, &sigact, NULL) != 0) - fatal("sigaction failed"); - if (sigaction(SIGUSR1, &sigact, NULL) != 0) - fatal("sigaction failed"); - if (sigaction(SIGUSR2, &sigact, NULL) != 0) - fatal("sigaction failed"); - if (sigaction(SIGTSTP, &sigact, NULL) != 0) - fatal("sigaction failed"); - - signal_set(&ev_sigcont, SIGCONT, client_signal, NULL); - signal_add(&ev_sigcont, NULL); - signal_set(&ev_sigterm, SIGTERM, client_signal, NULL); - signal_add(&ev_sigterm, NULL); - signal_set(&ev_sigwinch, SIGWINCH, client_signal, NULL); - signal_add(&ev_sigwinch, NULL); + set_signals(client_signal); /* * imsg_read in the first client poll loop (before the terminal has |