summary refs log tree commit diff
path: root/src/jobs.c
diff options
context:
space:
mode:
authorherbert <herbert@gondor.apana.org.au>2005-02-25 20:49:13 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2005-09-26 18:33:03 +1000
commite994ac70a4d85cd933e674e0df70301dd86637ee (patch)
tree0b61fe1663a448911aac3b3a775f0e433c73d024 /src/jobs.c
parentRelease 0.5.2. (diff)
downloaddash-e994ac70a4d85cd933e674e0df70301dd86637ee.tar.gz
dash-e994ac70a4d85cd933e674e0df70301dd86637ee.zip
Changed boolean rootshell into shlvl counter.
Diffstat (limited to '')
-rw-r--r--src/jobs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/jobs.c b/src/jobs.c
index 132c47a..b82bf50 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -838,19 +838,19 @@ growjobtab(void)
 STATIC inline void
 forkchild(struct job *jp, union node *n, int mode)
 {
-	int wasroot;
+	int oldlvl;
 	pid_t pgrp;
 
 	TRACE(("Child shell %d\n", getpid()));
-	wasroot = rootshell;
-	rootshell = 0;
+	oldlvl = shlvl;
+	shlvl++;
 
 	closescript();
 	clear_traps();
 #if JOBS
 	/* do job control only in root shell */
 	jobctl = 0;
-	if (mode != FORK_NOJOB && jp->jobctl && wasroot) {
+	if (mode != FORK_NOJOB && jp->jobctl && !oldlvl) {
 		if (jp->nprocs == 0)
 			pgrp = getpid();
 		else
@@ -872,7 +872,7 @@ forkchild(struct job *jp, union node *n, int mode)
 				error("Can't open %s", _PATH_DEVNULL);
 		}
 	}
-	if (wasroot && iflag) {
+	if (!oldlvl && iflag) {
 		setsignal(SIGINT);
 		setsignal(SIGQUIT);
 		setsignal(SIGTERM);
9-02-22 16:07:32 -0500'>2019-02-22Add /znc commandJune McEnroe Only because ZNC tells you to use it and expects it to work. 2019-02-22Update status line after scrolling and term eventsJune McEnroe 2019-02-22Reorganize input.cJune McEnroe 2019-02-22Fix name of <raw> window in man pageJune McEnroe 2019-02-22Rename global tags with angle bracketsJune McEnroe 2019-02-22Show status window while connectingJune McEnroe 2019-02-22Reorganize UI code for the umpteenth timeJune McEnroe It's actually in a good state now, I think. 2019-02-21Replace "view" with "window"June McEnroe I think originally I didn't want to use the same word as curses WINDOW but it's really much clearer for the user if they're just called windows. UI code probably needs yet another rewrite though. Still feels messy. 2019-02-21Remove ROT13June McEnroe It's just not convenient when it can only do the whole line... 2019-02-21Clean up man pageJune McEnroe 2019-01-26Draw UI before connectingJune McEnroe Otherwise the "Traveling" message isn't visible while connecting. 2019-01-25Avoid unused variable warnings with getyxJune McEnroe 2019-01-25Add GNU/Linux build instructionsJune McEnroe