diff options
author | Tiago Cunha <tcunha@gmx.com> | 2010-04-22 21:48:49 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2010-04-22 21:48:49 +0000 |
commit | 7163907ab64fd5419847d7833aff3850d0e68a38 (patch) | |
tree | 1229d05941d757fc4955d822a0223c75a7b50f47 | |
parent | 02fc1fe0da8b6175956cb23d7d34f040f10129b5 (diff) | |
download | rtmux-7163907ab64fd5419847d7833aff3850d0e68a38.tar.gz rtmux-7163907ab64fd5419847d7833aff3850d0e68a38.tar.bz2 rtmux-7163907ab64fd5419847d7833aff3850d0e68a38.zip |
Sync OpenBSD patchset 684:
Catch SIGCHLD to avoid a zombie, from patrick keshishian.
-rw-r--r-- | tmux.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: tmux.c,v 1.204 2010-02-26 13:31:39 tcunha Exp $ */ +/* $Id: tmux.c,v 1.205 2010-04-22 21:48:49 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -241,6 +241,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; @@ -540,6 +541,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); |