=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server.c,v retrieving revision 1.182 retrieving revision 1.183 diff -c -r1.182 -r1.183 *** src/usr.bin/tmux/server.c 2018/08/18 20:08:52 1.182 --- src/usr.bin/tmux/server.c 2018/08/23 15:45:05 1.183 *************** *** 1,4 **** ! /* $OpenBSD: server.c,v 1.182 2018/08/18 20:08:52 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server.c,v 1.183 2018/08/23 15:45:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 162,168 **** char *lockfile) { int pair[2]; - struct job *job; sigset_t set, oldset; struct client *c; char *cause = NULL; --- 162,167 ---- *************** *** 223,239 **** } start_cfg(); - 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); } --- 222,234 ---- } start_cfg(); server_add_accept(0); proc_loop(server_proc, server_loop); ! job_kill_all(); status_prompt_save_history(); + exit(0); } *************** *** 243,249 **** { struct client *c; u_int items; - struct job *job; do { items = cmdq_next(NULL); --- 238,243 ---- *************** *** 276,285 **** if (!TAILQ_EMPTY(&clients)) return (0); ! LIST_FOREACH(job, &all_jobs, entry) { ! if ((~job->flags & JOB_NOWAIT) && job->state == JOB_RUNNING) ! return (0); ! } return (1); } --- 270,277 ---- if (!TAILQ_EMPTY(&clients)) return (0); ! if (job_still_running()) ! return (0); return (1); } *************** *** 457,463 **** { struct window *w, *w1; struct window_pane *wp; - struct job *job; RB_FOREACH_SAFE(w, windows, &windows, w1) { TAILQ_FOREACH(wp, &w->panes, entry) { --- 449,454 ---- *************** *** 474,486 **** } } } ! ! LIST_FOREACH(job, &all_jobs, entry) { ! if (pid == job->pid) { ! job_died(job, status); /* might free job */ ! break; ! } ! } } /* Handle stopped children. */ --- 465,471 ---- } } } ! job_check_died(pid, status); } /* Handle stopped children. */