=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/job.c,v retrieving revision 1.46 retrieving revision 1.47 diff -c -r1.46 -r1.47 *** src/usr.bin/tmux/job.c 2017/07/12 09:24:17 1.46 --- src/usr.bin/tmux/job.c 2017/07/12 10:04:51 1.47 *************** *** 1,4 **** ! /* $OpenBSD: job.c,v 1.46 2017/07/12 09:24:17 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: job.c,v 1.47 2017/07/12 10:04:51 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 51,56 **** --- 51,57 ---- pid_t pid; int nullfd, out[2]; const char *home; + sigset_t set, oldset; if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, out) != 0) return (NULL); *************** *** 61,74 **** */ env = environ_for_session(s, !cfg_finished); switch (pid = fork()) { case -1: environ_free(env); close(out[0]); close(out[1]); return (NULL); ! case 0: /* child */ proc_clear_signals(server_proc); if (cwd == NULL || chdir(cwd) != 0) { if ((home = find_home()) == NULL || chdir(home) != 0) --- 62,79 ---- */ env = environ_for_session(s, !cfg_finished); + sigfillset(&set); + sigprocmask(SIG_BLOCK, &set, &oldset); switch (pid = fork()) { case -1: + sigprocmask(SIG_SETMASK, &oldset, NULL); environ_free(env); close(out[0]); close(out[1]); return (NULL); ! case 0: proc_clear_signals(server_proc); + sigprocmask(SIG_SETMASK, &oldset, NULL); if (cwd == NULL || chdir(cwd) != 0) { if ((home = find_home()) == NULL || chdir(home) != 0) *************** *** 100,106 **** fatal("execl failed"); } ! /* parent */ environ_free(env); close(out[1]); --- 105,111 ---- fatal("execl failed"); } ! sigprocmask(SIG_SETMASK, &oldset, NULL); environ_free(env); close(out[1]);