job control: don't kill PTY processes on exit

These will automatically recieve SIGHUP on closing PTY master.
This commit is contained in:
Björn Linse 2016-01-18 13:54:20 +01:00
parent 4618307a6c
commit f6ecd127b9

View File

@ -120,9 +120,14 @@ void process_teardown(Loop *loop) FUNC_ATTR_NONNULL_ALL
// Close handles to process without killing it.
CREATE_EVENT(loop->events, process_close_handles, 1, proc);
} else {
uv_kill(proc->pid, SIGTERM);
proc->term_sent = true;
process_stop(proc);
if (proc->type == kProcessTypeUv) {
uv_kill(proc->pid, SIGTERM);
proc->term_sent = true;
process_stop(proc);
} else { // kProcessTypePty
process_close_streams(proc);
pty_process_close_master((PtyProcess *)proc);
}
}
}