Currently, we may report incorrect success when loading a URL, as we
only check the return value of process_run_sync() (and not the process
exit status itself) in load_process_to_local_file.
This fix adds a check to the synchronous load.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
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;
}