From 2ad0e66f61e8f8488cff208f8bb7f5127ec9f813 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Tue, 21 Jan 2014 10:00:49 +0800 Subject: 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 --- discover/paths.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'discover') 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; -- cgit v1.2.1