From b902f9b4d48328e00d92188f432568b3b3c07391 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 5 Aug 2024 11:26:57 +0200 Subject: When using errno, log the actual error message For the user it is more useful to see the actual error message, provided by strerror(), than the pure error code. --- src/other_tools/just_mr/launch.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/other_tools/just_mr/launch.cpp') diff --git a/src/other_tools/just_mr/launch.cpp b/src/other_tools/just_mr/launch.cpp index d83ef8e5..ccebd966 100644 --- a/src/other_tools/just_mr/launch.cpp +++ b/src/other_tools/just_mr/launch.cpp @@ -14,7 +14,8 @@ #include "src/other_tools/just_mr/launch.hpp" -#include // for errno +#include // for errno +#include // for strerror() #include #include @@ -256,6 +257,6 @@ auto CallJust(std::optional const& config_file, [[maybe_unused]] auto res = execvp(argv[0], static_cast(argv.data())); // execvp returns only if command errored out - Logger::Log(LogLevel::Error, "execvp failed with error code {}", errno); + Logger::Log(LogLevel::Error, "execvp failed with:\n{}", strerror(errno)); return kExitExecError; } -- cgit v1.2.3