notify: if execve() failed, always show original error

This commit is contained in:
Mike Yuan
2024-01-30 03:27:36 +08:00
parent 7e26863e9c
commit a3158ff36e
+2 -7
View File
@@ -448,15 +448,10 @@ static int run(int argc, char* argv[]) {
}
if (arg_exec) {
_cleanup_free_ char *cmdline = NULL;
execvp(arg_exec[0], arg_exec);
cmdline = strv_join(arg_exec, " ");
if (!cmdline)
return log_oom();
return log_error_errno(errno, "Failed to execute command line: %s", cmdline);
_cleanup_free_ char *cmdline = strv_join(arg_exec, " ");
return log_error_errno(errno, "Failed to execute command line: %s", strnull(cmdline));
}
/* The DEFINE_MAIN_FUNCTION_WITH_POSITIVE_FAILURE() boilerplate will send the exit status via