builder: Handle chdir failures when spawning shell

tingping/wmclass
Alexander Larsson 2017-02-28 11:11:28 +01:00
parent 78b5c2fbf5
commit 0b448c5f68
1 changed files with 6 additions and 1 deletions

View File

@ -881,7 +881,12 @@ shell (GFile *app_dir,
g_ptr_array_add (args, "sh");
g_ptr_array_add (args, NULL);
chdir (flatpak_file_get_path_cached (cwd_file));
if (chdir (flatpak_file_get_path_cached (cwd_file)))
{
glnx_set_error_from_errno (error);
return FALSE;
}
if (execvp ((char *) args->pdata[0], (char **) args->pdata) == -1)
{
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "Unable to start flatpak build");