From a7243e7e7bfb3242c97738d69b0e504aeab3d094 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sun, 2 Oct 2022 17:21:18 +0800 Subject: [PATCH] fix: log perror format --- src/utils/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/process.c b/src/utils/process.c index 5eadb3a..ccb1834 100644 --- a/src/utils/process.c +++ b/src/utils/process.c @@ -51,7 +51,7 @@ void process_exec(process *proc) { log_info("%s start", proc->name); process_dump(proc); if ((pid = fork()) < 0) { // fork error - log_perror("%s fork error", proc->name); + log_perror("%s fork error -> ", proc->name); server_exit(EXIT_FORK_ERROR); } else if (pid == 0) { // child process if (chdir(proc->cwd)) { // change working directory @@ -172,7 +172,7 @@ void get_sub_exit() { // catch child process exit } int wait_ret = waitpid(-1, &status, WNOHANG); // waitpid for all sub-process (non-blocking) if (wait_ret == -1) { - log_perror("Waitpid error"); + log_perror("Waitpid error -> "); server_exit(EXIT_WAIT_ERROR); } else if (wait_ret) { // process exit char *exit_msg = get_exit_msg(status);