From ad0f0061816c5f0b1377f91a9ccea4c73e8ff03e Mon Sep 17 00:00:00 2001 From: Pedro Falcato Date: Thu, 2 Mar 2023 19:11:23 +0000 Subject: [PATCH] Print PIDs and exit status in decimal Also add a trailing newline for the child-SIGNALED case. --- src/utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index 1870acf4..054c1f00 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -525,13 +525,13 @@ void MySystem(char * sysCmd, char ** sysArgv) if (PCM::getInstance()->isBlocked()) { int res; waitpid(child_pid, &res, 0); - std::cerr << "Program " << sysCmd << " launched with PID: " << child_pid << "\n"; + std::cerr << "Program " << sysCmd << " launched with PID: " << std::dec << child_pid << "\n"; if (WIFEXITED(res)) { std::cerr << "Program exited with status " << WEXITSTATUS(res) << "\n"; } else if (WIFSIGNALED(res)) { - std::cerr << "Process " << child_pid << " was terminated with status " << WTERMSIG(res); + std::cerr << "Process " << child_pid << " was terminated with status " << WTERMSIG(res) << "\n"; } } }