diff options
author | Chet Ramey <chet.ramey@case.edu> | 2020-04-10 18:26:33 -0400 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2020-04-10 18:26:33 -0400 |
commit | b3968b54c13def5803efc82d4c63d84446fe28bf (patch) | |
tree | db5d03afcacdb58ca647ccc3d81042c67fd18d44 /jobs.c | |
parent | ea31c00845c858098d232bd014bf27b5a63a668b (diff) | |
download | bash-b3968b54c13def5803efc82d4c63d84446fe28bf.tar.gz |
commit bash-20200408 snapshot
Diffstat (limited to 'jobs.c')
-rw-r--r-- | jobs.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -3286,6 +3286,8 @@ wait_for_any_job (flags, ps) BLOCK_CHILD (set, oset); for (i = 0; i < js.j_jobslots; i++) { + if ((flags & JWAIT_WAITING) && jobs[i] && IS_WAITING (i) == 0) + continue; /* if we don't want it, skip it */ if (jobs[i] && DEADJOB (i) && IS_NOTIFIED (i) == 0) { return_job: @@ -3336,8 +3338,12 @@ return_job: /* Now we see if we have any dead jobs and return the first one */ BLOCK_CHILD (set, oset); for (i = 0; i < js.j_jobslots; i++) - if (jobs[i] && DEADJOB (i)) - goto return_job; + { + if ((flags & JWAIT_WAITING) && jobs[i] && IS_WAITING (i) == 0) + continue; /* if we don't want it, skip it */ + if (jobs[i] && DEADJOB (i)) + goto return_job; + } UNBLOCK_CHILD (oset); } |