discover/paths: Check process exit status when loading URLs
[petitboot] / discover / paths.c
index 5e577ebc7baeee7b96871339acbb6279fcc3cb56..58fbffdc3e58f7aaa3a6f534a2f8dbeb003eeb73 100644 (file)
@@ -131,7 +131,10 @@ static void load_process_to_local_file(struct load_task *task,
                task->result->status = rc ? LOAD_ERROR : LOAD_ASYNC;
        } else {
                rc = process_run_sync(task->process);
-               task->result->status = rc ? LOAD_ERROR : LOAD_OK;
+               if (rc || WEXITSTATUS(task->process->exit_status))
+                       task->result->status = LOAD_ERROR;
+               else
+                       task->result->status = LOAD_OK;
                process_release(task->process);
                task->process = NULL;
        }