From bc291dcbd885f2865c49f72a51e6343a65b41b98 Mon Sep 17 00:00:00 2001 From: Johannes Bauer Date: Tue, 16 Jan 2018 19:36:38 +0100 Subject: [PATCH] Change stupid debug message and output more debug info When compiled in debug mode, output more info. Also change the insanely stupid "exited successfully" message to something actually sensible. --- exec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exec.c b/exec.c index b6a4fee..5e2815c 100644 --- a/exec.c +++ b/exec.c @@ -93,7 +93,11 @@ struct runresult_t exec_command(const char **argv) { } if (pid == 0) { /* Child */ +#ifdef DEBUG const bool silent = true; +#else + const bool silent = false; +#endif if (silent) { /* Shut up the child if user did not request debug output */ close(1); @@ -117,7 +121,7 @@ struct runresult_t exec_command(const char **argv) { runresult.returncode = WEXITSTATUS(status); } argv_free(argvcopy); - log_msg(LLVL_DEBUG, "Subprocess (PID %d): %s %s returned %d", pid, argv[0], runresult.success ? "successfully" : "unsuccessfully", runresult.returncode); + log_msg(LLVL_DEBUG, "Subprocess (PID %d): %s exited with returncode %d", pid, argv[0], runresult.returncode); return runresult; }