Date: Sat, 27 Apr 2013 14:07:26 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249984 - head/bin/sh Message-ID: <201304271407.r3RE7QI1013253@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Sat Apr 27 14:07:25 2013 New Revision: 249984 URL: http://svnweb.freebsd.org/changeset/base/249984 Log: 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. Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Apr 27 13:26:35 2013 (r249983) +++ head/bin/sh/jobs.c Sat Apr 27 14:07:25 2013 (r249984) @@ -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); + } } } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304271407.r3RE7QI1013253>