Browse Source

ash: move TRACE statement in evalcommand()

Following recent work on evalcommand() a TRACE statement to report
the status of a forked command was left in the wrong place.

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Ron Yorston 4 years ago
parent
commit
6cda0b04a3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      shell/ash.c

+ 2 - 1
shell/ash.c

@@ -10392,7 +10392,6 @@ evalcommand(union node *cmd, int flags)
 			jp = makejob(/*cmd,*/ 1);
 			if (forkshell(jp, cmd, FORK_FG) != 0) {
 				/* parent */
-				TRACE(("forked child exited with %d\n", status));
 				break;
 			}
 			/* child */
@@ -10418,6 +10417,8 @@ evalcommand(union node *cmd, int flags)
 	} /* switch */
 
 	status = waitforjob(jp);
+	if (jp)
+		TRACE(("forked child exited with %d\n", status));
 	FORCE_INT_ON;
 
  out: