shared: log error when execve fail

If there is an error with the execv call in fork_agent the
program exits without any meaningful log message. Log the
command and errno so the user gets more information about
the failure.

Fixes: #33418

Signed-off-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
This commit is contained in:
Mauri de Souza Meneguzzo
2024-07-22 10:12:35 +01:00
committed by Luca Boccassi
parent e261f27ef0
commit a408d44531
2 changed files with 9 additions and 3 deletions
+1
View File
@@ -606,5 +606,6 @@ int fork_agent(const char *name, const int except[], size_t n_except, pid_t *ret
va_end(ap);
execv(path, l);
log_error_errno(errno, "Failed to execute %s: %m", path);
_exit(EXIT_FAILURE);
}