From 50239a665c88f5a95ce41146804500f5da90b19e Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 12 Sep 2021 11:21:08 +0100 Subject: [PATCH] ash: stopped jobs should only prevent exit from interactive shell When the user tries to exit an interactive shell with stopped jobs present the shell issues a warning and only exits if the user insists by trying to exit again. This shouldn't apply to non-interactive shells. Reported-by: Roberto A. Foglietta Signed-off-by: Ron Yorston Signed-off-by: Denys Vlasenko --- shell/ash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/ash.c b/shell/ash.c index 152b3b46a..5743b2377 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -5451,7 +5451,7 @@ stoppedjobs(void) int retval; retval = 0; - if (job_warning) + if (!iflag || job_warning) goto out; jp = curjob; if (jp && jp->state == JOBSTOPPED) {