diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-08-05 11:26:57 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-08-05 11:36:59 +0200 |
commit | b902f9b4d48328e00d92188f432568b3b3c07391 (patch) | |
tree | 902d8fd0b91853d87ac2d2cadd7d14595a37fabf /src/other_tools/just_mr/launch.cpp | |
parent | da2ebe2b5cfef7b0f2e49160aa22ef5020fa964b (diff) | |
download | justbuild-b902f9b4d48328e00d92188f432568b3b3c07391.tar.gz |
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.
Diffstat (limited to 'src/other_tools/just_mr/launch.cpp')
-rw-r--r-- | src/other_tools/just_mr/launch.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 <cerrno> // for errno +#include <cerrno> // for errno +#include <cstring> // for strerror() #include <filesystem> #include <utility> @@ -256,6 +257,6 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file, [[maybe_unused]] auto res = execvp(argv[0], static_cast<char* const*>(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; } |