=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server.c,v retrieving revision 1.166 retrieving revision 1.167 diff -c -r1.166 -r1.167 *** src/usr.bin/tmux/server.c 2017/02/09 15:04:53 1.166 --- src/usr.bin/tmux/server.c 2017/04/20 09:20:22 1.167 *************** *** 1,4 **** ! /* $OpenBSD: server.c,v 1.166 2017/02/09 15:04:53 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server.c,v 1.167 2017/04/20 09:20:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 134,140 **** int server_start(struct event_base *base, int lockfd, char *lockfile) { ! int pair[2]; if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pair) != 0) fatal("socketpair failed"); --- 134,141 ---- int server_start(struct event_base *base, int lockfd, char *lockfile) { ! int pair[2]; ! struct job *job; if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pair) != 0) fatal("socketpair failed"); *************** *** 180,185 **** --- 181,192 ---- server_add_accept(0); proc_loop(server_proc, server_loop); + + LIST_FOREACH(job, &all_jobs, entry) { + if (job->pid != -1) + kill(job->pid, SIGTERM); + } + status_prompt_save_history(); exit(0); } *************** *** 400,406 **** } } ! LIST_FOREACH(job, &all_jobs, lentry) { if (pid == job->pid) { job_died(job, status); /* might free job */ break; --- 407,413 ---- } } ! LIST_FOREACH(job, &all_jobs, entry) { if (pid == job->pid) { job_died(job, status); /* might free job */ break;