Source-Changes-HG archive

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

[src/trunk]: src/bin/sh Since "struct job" gained a pgrp member some time ago...



details:   https://anonhg.NetBSD.org/src/rev/92854c9b1bf8
branches:  trunk
changeset: 943310:92854c9b1bf8
user:      kre <kre%NetBSD.org@localhost>
date:      Sun Aug 30 19:45:05 2020 +0000

description:
Since "struct job" gained a pgrp member some time ago now, use it
instead of simply assuming that the pid of the first (leftmost) process
in a pipeline is the pgrp - someday we may switch things around and
create pipelines right to left instead, which has several advantages,
but which would invalidate the assumption which was being made here.

diffstat:

 bin/sh/jobs.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r dbb5430d5b5c -r 92854c9b1bf8 bin/sh/jobs.c
--- a/bin/sh/jobs.c     Sun Aug 30 19:41:39 2020 +0000
+++ b/bin/sh/jobs.c     Sun Aug 30 19:45:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: jobs.c,v 1.108 2020/08/20 23:03:17 kre Exp $   */
+/*     $NetBSD: jobs.c,v 1.109 2020/08/30 19:45:05 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.108 2020/08/20 23:03:17 kre Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.109 2020/08/30 19:45:05 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -971,7 +971,7 @@
        jp = getjob(name, 1);
        if (jp == 0)
                return 0;
-       return -jp->ps[0].pid;
+       return -jp->pgrp;
 }
 
 /*



Home | Main Index | Thread Index | Old Index