[PATCH] ash: move TRACE statement in evalcommand()

Ron Yorston rmy at pobox.com
Fri Feb 21 16:16:56 UTC 2020


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 at pobox.com>
---
 shell/ash.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/shell/ash.c b/shell/ash.c
index fd2fc9f23..71f79d430 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -10390,7 +10390,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 */
@@ -10416,6 +10415,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:
-- 
2.24.1



More information about the busybox mailing list