X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/44531c0a0a157031639c2cb9338f323bbea371f6..329310630e302987fe923eb19b075d3cdd16a9f6:/bin/sh/jobs.c diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index b679bac91c..39dba1929b 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)jobs.c 8.5 (Berkeley) 5/4/95 - * $FreeBSD: src/bin/sh/jobs.c,v 1.92 2011/02/04 22:47:55 jilles Exp $ + * $FreeBSD: src/bin/sh/jobs.c,v 1.94 2011/06/12 23:06:04 jilles Exp $ */ #include @@ -69,6 +69,7 @@ #include "memalloc.h" #include "error.h" #include "mystring.h" +#include "var.h" static struct job *jobtab; /* array of jobs */ @@ -797,6 +798,7 @@ forkshell(struct job *jp, union node *n, int mode) handler = &main_handler; closescript(); INTON; + forcelocal = 0; clear_traps(); #if JOBS jobctl = 0; /* do job control only in root shell */ @@ -819,7 +821,7 @@ forkshell(struct job *jp, union node *n, int mode) ! fd0_redirected_p ()) { close(0); if (open(_PATH_DEVNULL, O_RDONLY) != 0) - error("Can't open %s: %s", + error("cannot open %s: %s", _PATH_DEVNULL, strerror(errno)); } } @@ -831,7 +833,7 @@ forkshell(struct job *jp, union node *n, int mode) ! fd0_redirected_p ()) { close(0); if (open(_PATH_DEVNULL, O_RDONLY) != 0) - error("Can't open %s: %s", + error("cannot open %s: %s", _PATH_DEVNULL, strerror(errno)); } } @@ -1124,7 +1126,7 @@ backgndpidset(void) pid_t backgndpidval(void) { - if (bgjob != NULL) + if (bgjob != NULL && !forcelocal) bgjob->remembered = 1; return backgndpid; }