Module Name: src
Committed By: kre
Date: Sun Aug 30 19:45:05 UTC 2020
Modified Files:
src/bin/sh: jobs.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/bin/sh/jobs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/jobs.c
diff -u src/bin/sh/jobs.c:1.108 src/bin/sh/jobs.c:1.109
--- src/bin/sh/jobs.c:1.108 Thu Aug 20 23:03:17 2020
+++ src/bin/sh/jobs.c Sun Aug 30 19:45:05 2020
@@ -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 @@ getjobpgrp(const char *name)
jp = getjob(name, 1);
if (jp == 0)
return 0;
- return -jp->ps[0].pid;
+ return -jp->pgrp;
}
/*