From 1b1aa07414fc86858666b7b33c7dd6bef69303fa Mon Sep 17 00:00:00 2001 From: Leonardo Boiko Date: Wed, 7 Nov 2012 10:23:04 -0200 Subject: [PATCH] When exiting, only warn about _stopped_ background jobs (fix #111) --- reader.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reader.cpp b/reader.cpp index cd9d9e450..c8e28bfa8 100644 --- a/reader.cpp +++ b/reader.cpp @@ -2819,7 +2819,7 @@ int exit_status() static void handle_end_loop() { job_t *j; - int job_count=0; + int stopped_jobs_count=0; int is_breakpoint=0; block_t *b; parser_t &parser = parser_t::principal_parser(); @@ -2838,14 +2838,14 @@ static void handle_end_loop() job_iterator_t jobs; while ((j = jobs.next())) { - if (!job_is_completed(j)) + if (!job_is_completed(j) && (job_is_stopped(j))) { - job_count++; + stopped_jobs_count++; break; } } - if (!reader_exit_forced() && !data->prev_end_loop && job_count && !is_breakpoint) + if (!reader_exit_forced() && !data->prev_end_loop && stopped_jobs_count && !is_breakpoint) { writestr(_(L"There are stopped jobs. A second attempt to exit will enforce their termination.\n"));