diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-01-21 10:00:49 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-01-21 13:36:01 +0800 |
commit | 2ad0e66f61e8f8488cff208f8bb7f5127ec9f813 (patch) | |
tree | aa676b143507346dbde4998bdd38f8e375387cb6 /discover/paths.c | |
parent | 6acda62401f17924b7004e25d038533e282903a1 (diff) | |
download | talos-petitboot-2ad0e66f61e8f8488cff208f8bb7f5127ec9f813.tar.gz talos-petitboot-2ad0e66f61e8f8488cff208f8bb7f5127ec9f813.zip |
lib/process: Add helper for check process clean exit
We have a few incorrect checks for the exit status of a process; this
change adds a helper with the correct WIFEXITED && WEXITSTATUS==0 logic.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/paths.c')
-rw-r--r-- | discover/paths.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discover/paths.c b/discover/paths.c index 58fbffd..54774cf 100644 --- a/discover/paths.c +++ b/discover/paths.c @@ -86,7 +86,7 @@ static void load_url_process_exit(struct process *process) if (result->status == LOAD_CANCELLED) { load_url_result_cleanup_local(result); - } else if (process->exit_status == 0) { + } else if (process_exit_ok(process)) { result->status = LOAD_OK; } else { result->status = LOAD_ERROR; @@ -131,7 +131,7 @@ 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); - if (rc || WEXITSTATUS(task->process->exit_status)) + if (rc || !process_exit_ok(task->process)) task->result->status = LOAD_ERROR; else task->result->status = LOAD_OK; |