diff options
author | 2010-05-03 16:06:32 +0000 | |
---|---|---|
committer | 2010-05-03 16:06:32 +0000 | |
commit | 5b7391fe929e73a6a012719b07f7fee9d18be6e4 (patch) | |
tree | a125c1e98249a8deb0bc3dd8688287e55b6d8dd9 /usr.bin/tmux/client.c | |
parent | Provide a disk_map() function which attempts to map a disklabel UID to the (diff) | |
download | wireguard-openbsd-5b7391fe929e73a6a012719b07f7fee9d18be6e4.tar.xz wireguard-openbsd-5b7391fe929e73a6a012719b07f7fee9d18be6e4.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 'usr.bin/tmux/client.c')
-rw-r--r-- | usr.bin/tmux/client.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c index d49e63e73ab..036fe1a45a6 100644 --- a/usr.bin/tmux/client.c +++ b/usr.bin/tmux/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.35 2009/12/03 22:50:09 nicm Exp $ */ +/* $OpenBSD: client.c,v 1.36 2010/05/03 16:06:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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 |