Source-Changes-HG archive

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

[src/trunk]: src/bin/sh From David Laight:



details:   https://anonhg.NetBSD.org/src/rev/831e47d1ad75
branches:  trunk
changeset: 538627:831e47d1ad75
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Oct 23 19:46:06 2002 +0000

description:
>From David Laight:

> Also 'jobs' fails in a non-interactive shell.
> In showjobs(), the code that puts the process back into its
> own process group should only be run if the shell is actually
> doing job control - eg if 'mflag' is set.

diffstat:

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

diffs (27 lines):

diff -r ac7b740e265a -r 831e47d1ad75 bin/sh/jobs.c
--- a/bin/sh/jobs.c     Wed Oct 23 19:39:42 2002 +0000
+++ b/bin/sh/jobs.c     Wed Oct 23 19:46:06 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: jobs.c,v 1.53 2002/09/28 03:15:43 mycroft Exp $        */
+/*     $NetBSD: jobs.c,v 1.54 2002/10/23 19:46:06 christos Exp $       */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c     8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.53 2002/09/28 03:15:43 mycroft Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.54 2002/10/23 19:46:06 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -354,7 +354,7 @@
         * Check if we are not in our foreground group, and if not
         * put us in it.
         */
-       if (gotpid != -1 && tcgetpgrp(ttyfd) != getpid()) {
+       if (mflag && gotpid != -1 && tcgetpgrp(ttyfd) != getpid()) {
                if (tcsetpgrp(ttyfd, getpid()) == -1)
                        error("Cannot set tty process group (%s) at %d",
                            strerror(errno), __LINE__);



Home | Main Index | Thread Index | Old Index