summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/client.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2010-05-04 08:48:06 +0000
committernicm <nicm@openbsd.org>2010-05-04 08:48:06 +0000
commit9e13073cf66c8935516cc1221f4db891f6f84106 (patch)
tree683c8f4951ff61534cca44897e4fa51bbcc08d44 /usr.bin/tmux/client.c
parentAdd some documentation about the last change (nexthop verification and (diff)
downloadwireguard-openbsd-9e13073cf66c8935516cc1221f4db891f6f84106.tar.xz
wireguard-openbsd-9e13073cf66c8935516cc1221f4db891f6f84106.zip
Revert last change, it appears to be broken somehow.
Diffstat (limited to 'usr.bin/tmux/client.c')
-rw-r--r--usr.bin/tmux/client.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c
index 036fe1a45a6..97c9f9bb06d 100644
--- a/usr.bin/tmux/client.c
+++ b/usr.bin/tmux/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.36 2010/05/03 16:06:32 nicm Exp $ */
+/* $OpenBSD: client.c,v 1.37 2010/05/04 08:48:06 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -172,12 +172,35 @@ 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. */
- set_signals(client_signal);
+ 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);
/*
* imsg_read in the first client poll loop (before the terminal has