Fix hup_background_jobs (née kill_background_jobs) implementation

This was introduced in 1b1bc28c0a but did
not cause any problems until the job control refactor, which caused it
to attempt to signal the calling `exec` builtin's own (invalid) pgrp
with SIGHUP.

Also improved debugging for `j->signal()` failures by printing the
signal we tried sending in case of error, rename the function to
`hup_background_jobs`, and move it from `reader.h`/`reader.cpp` to
`proc.h`/`proc.cpp`.
This commit is contained in:
Mahmoud Al-Qudsi
2018-10-20 13:58:51 -05:00
parent 4d3b56c151
commit 0d8334a31b
5 changed files with 27 additions and 17 deletions

View File

@@ -786,7 +786,7 @@ parse_execution_result_t parse_execution_context_t::populate_plain_process(
return parse_execution_errored;
}
else {
kill_background_jobs();
hup_background_jobs();
}
}
}