Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh A change in rev 1.91 interacted badly with the way th...



details:   https://anonhg.NetBSD.org/src/rev/af5c394f89a1
branches:  trunk
changeset: 993469:af5c394f89a1
user:      kre <kre%NetBSD.org@localhost>
date:      Thu Sep 13 22:12:35 2018 +0000

description:
A change in rev 1.91 interacted badly with the way that showjobs()
worked, preventing $(jobs) (and more usefully $(jobs -p) from
working.   Fix that.

XXX pullup -8

diffstat:

 bin/sh/jobs.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r 83cabab8bf9f -r af5c394f89a1 bin/sh/jobs.c
--- a/bin/sh/jobs.c     Thu Sep 13 22:00:58 2018 +0000
+++ b/bin/sh/jobs.c     Thu Sep 13 22:12:35 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: jobs.c,v 1.100 2018/09/04 23:16:30 kre Exp $   */
+/*     $NetBSD: jobs.c,v 1.101 2018/09/13 22:12:35 kre Exp $   */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c     8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.100 2018/09/04 23:16:30 kre Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.101 2018/09/13 22:12:35 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -586,14 +586,13 @@
                silent = 1;
        }
 #endif
-       if (jobs_invalid)
-               return;
 
        for (jobno = 1, jp = jobtab ; jobno <= njobs ; jobno++, jp++) {
                if (!jp->used)
                        continue;
                if (jp->nprocs == 0) {
-                       freejob(jp);
+                       if (!jobs_invalid)
+                               freejob(jp);
                        continue;
                }
                if ((mode & SHOW_CHANGED) && !(jp->flags & JOBCHANGED))



Home | Main Index | Thread Index | Old Index