Use strerror to display execve failures

Fixes #4501
This commit is contained in:
Maxime Coste 2022-01-24 21:59:16 +11:00
parent 6f135c0c8e
commit f8a86149e5

View File

@ -134,7 +134,7 @@ pid_t spawn_shell(const char* shell, StringView cmdline,
execve(shell, (char* const*)execparams.data(), (char* const*)envptrs.data()); execve(shell, (char* const*)execparams.data(), (char* const*)envptrs.data());
char buffer[1024]; 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); _exit(-1);
return -1; return -1;
} }