=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tmux.c,v retrieving revision 1.73 retrieving revision 1.74 diff -c -r1.73 -r1.74 *** src/usr.bin/tmux/tmux.c 2010/02/22 20:41:16 1.73 --- src/usr.bin/tmux/tmux.c 2010/04/18 13:41:29 1.74 *************** *** 1,4 **** ! /* $OpenBSD: tmux.c,v 1.73 2010/02/22 20:41:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tmux.c,v 1.74 2010/04/18 13:41:29 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 238,243 **** --- 238,244 ---- 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,542 **** --- 538,551 ---- 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);