forked from Mirrors/flatpak-builder
Handle exec error correctly
exec(1) states that exec will only return in case of an error, and the return value is -1. Therefore, if (!execv(...)) doesn't make sense.tingping/wmclass
parent
77a3259083
commit
dac709ef1d
|
@ -289,7 +289,7 @@ xdg_app_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **
|
|||
g_unsetenv ("LD_LIBRARY_PATH");
|
||||
g_setenv ("PATH", "/self/bin:/usr/bin", TRUE);
|
||||
|
||||
if (!execv (HELPER, (char **)argv_array->pdata))
|
||||
if (execv (HELPER, (char **)argv_array->pdata) == -1)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "Unable to start app");
|
||||
goto out;
|
||||
|
|
|
@ -1156,5 +1156,8 @@ main (int argc,
|
|||
|
||||
__debug__(("launch executable %s\n", args[0]));
|
||||
|
||||
return execvp (args[0], args);
|
||||
if (execvp (args[0], args) == -1)
|
||||
die_with_error ("execvp %s", args[0]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue