diff options
author | 2010-04-18 13:41:29 +0000 | |
---|---|---|
committer | 2010-04-18 13:41:29 +0000 | |
commit | 4b3112a2f7a85510e3e7f66d9dcc7d7ee15075b6 (patch) | |
tree | 4e58d4dda992e8369faa53d9c8c382d0a67ea574 /usr.bin/tmux/tmux.c | |
parent | Fix typo in escape state table leading to fatal() when \033} or \033~ (diff) | |
download | wireguard-openbsd-4b3112a2f7a85510e3e7f66d9dcc7d7ee15075b6.tar.xz wireguard-openbsd-4b3112a2f7a85510e3e7f66d9dcc7d7ee15075b6.zip |
Catch SIGCHLD to avoid a zombie, from patrick keshishian.
Diffstat (limited to 'usr.bin/tmux/tmux.c')
-rw-r--r-- | usr.bin/tmux/tmux.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c index 711a5ab1348..e0a77c29bc1 100644 --- a/usr.bin/tmux/tmux.c +++ b/usr.bin/tmux/tmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.c,v 1.73 2010/02/22 20:41:16 nicm Exp $ */ +/* $OpenBSD: tmux.c,v 1.74 2010/04/18 13:41:29 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -238,6 +238,7 @@ main(int argc, char **argv) struct keylist *keylist; struct env_data envdata; struct msg_command_data cmddata; + struct sigaction sigact; char *s, *shellcmd, *path, *label, *home, *cause; char cwd[MAXPATHLEN], **var; void *buf; @@ -537,6 +538,14 @@ main(int argc, char **argv) exit(1); } + /* Catch SIGCHLD to avoid a zombie when starting the server. */ + memset(&sigact, 0, sizeof sigact); + sigemptyset(&sigact.sa_mask); + sigact.sa_handler = SIG_IGN; + if (sigaction(SIGCHLD, &sigact, NULL) != 0) + fatal("sigaction failed"); + + /* Initialise the client socket/start the server. */ if ((main_ibuf = client_init(path, cmdflags, flags)) == NULL) exit(1); xfree(path); |