Merge sigint_checker_t generalizations from #7060

This makes it possible to expand the signals checked by the type. I can't merge
the sigttin fixes for #7060 yet because they introduce new breakage, but this
will make merging any future fix easier.
This commit is contained in:
Mahmoud Al-Qudsi
2020-06-20 11:23:36 -05:00
parent dd1a26588a
commit f2d5f95396
4 changed files with 14 additions and 11 deletions

View File

@@ -64,7 +64,7 @@ static bool any_jobs_finished(size_t jobs_len, const parser_t &parser) {
}
static int wait_for_backgrounds(parser_t &parser, bool any_flag) {
sigint_checker_t sigint;
sigchecker_t sigint(topic_t::sighupint);
size_t jobs_len = parser.jobs().size();
while ((!any_flag && !all_jobs_finished(parser)) ||
(any_flag && !any_jobs_finished(jobs_len, parser))) {
@@ -106,7 +106,7 @@ static bool any_specified_jobs_finished(const parser_t &parser, const std::vecto
static int wait_for_backgrounds_specified(parser_t &parser, const std::vector<job_id_t> &ids,
bool any_flag) {
sigint_checker_t sigint;
sigchecker_t sigint(topic_t::sighupint);
while ((!any_flag && !all_specified_jobs_finished(parser, ids)) ||
(any_flag && !any_specified_jobs_finished(parser, ids))) {
if (sigint.check()) {