From f8a86149e5ef5f41c7d40db12ced6f02bf2def0e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 24 Jan 2022 21:59:16 +1100 Subject: [PATCH] Use strerror to display execve failures Fixes #4501 --- src/shell_manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell_manager.cc b/src/shell_manager.cc index ac0eb43b..96cfb063 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -134,7 +134,7 @@ pid_t spawn_shell(const char* shell, StringView cmdline, execve(shell, (char* const*)execparams.data(), (char* const*)envptrs.data()); char buffer[1024]; - write(STDERR_FILENO, format_to(buffer, "execve failed: {}\n", errno)); + write(STDERR_FILENO, format_to(buffer, "execve failed: {}\n", strerror(errno))); _exit(-1); return -1; }