summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-04-27 14:07:25 +0000
committerjilles <jilles@FreeBSD.org>2013-04-27 14:07:25 +0000
commit9081eaa709fb6d185011cc61abf6b3c40f1cc010 (patch)
tree1a986e2d10833f66ebe5d62bd89d6e552b4a3f9d /bin
parent72dbb34e66701a0d22f36de94acbb3f84e7fcb79 (diff)
downloadFreeBSD-src-9081eaa709fb6d185011cc61abf6b3c40f1cc010.zip
FreeBSD-src-9081eaa709fb6d185011cc61abf6b3c40f1cc010.tar.gz
sh: Don't consider jobs -s/-p as reporting the status of jobs.
This ensures that something like j=$(jobs -p) does not prevent any status from being written to the terminal.
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/jobs.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index c978e3d..54f72ea 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -417,13 +417,15 @@ showjobs(int change, int mode)
if (change && ! jp->changed)
continue;
showjob(jp, mode);
- jp->changed = 0;
- /* Hack: discard jobs for which $! has not been referenced
- * in interactive mode when they terminate.
- */
- if (jp->state == JOBDONE && !jp->remembered &&
- (iflag || jp != bgjob)) {
- freejob(jp);
+ if (mode == SHOWJOBS_DEFAULT || mode == SHOWJOBS_VERBOSE) {
+ jp->changed = 0;
+ /* Hack: discard jobs for which $! has not been
+ * referenced in interactive mode when they terminate.
+ */
+ if (jp->state == JOBDONE && !jp->remembered &&
+ (iflag || jp != bgjob)) {
+ freejob(jp);
+ }
}
}
}
OpenPOWER on IntegriCloud