From 79d403e34e8a65b7f4c21f0dcb31fcc9c6fabc7d Mon Sep 17 00:00:00 2001 From: John Horne Date: Mon, 20 Apr 2020 16:59:53 +0100 Subject: [PATCH] Moved CMDEND code to outside for for loop. --- src/do_command.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/do_command.c b/src/do_command.c index dda8ff7..76939a1 100644 --- a/src/do_command.c +++ b/src/do_command.c @@ -581,14 +581,6 @@ static int child_process(entry * e, char **jobenv) { Debug(DPROC, ("[%ld] no more grandchildren--mail written?\n", (long) getpid())); - - if ((e->flags & DONT_LOG) == 0) { - char *x = mkprints((u_char *) e->cmd, strlen(e->cmd)); - - log_it(usernm, getpid(), "CMDEND", x, 0); - free(x); - } - break; } Debug(DPROC, ("[%ld] grandchild #%ld finished, status=%04x", @@ -597,6 +589,12 @@ static int child_process(entry * e, char **jobenv) { Debug(DPROC, (", dumped core")); Debug(DPROC, ("\n")); } + if ((e->flags & DONT_LOG) == 0) { + char *x = mkprints((u_char *) e->cmd, strlen(e->cmd)); + + log_it(usernm, getpid(), "CMDEND", x, 0); + free(x); + } return OK_EXIT; } -- 1.8.3.1