lib/process: Add helper for check process clean exit
[petitboot] / lib / pb-config / storage-powerpc-nvram.c
index 42de5984f02cc0e53537f864b8f3c067c2f0db03..4b4b87830ebee29428b85d875770f5fb2b4d3f02 100644 (file)
@@ -137,8 +137,7 @@ static int parse_nvram(struct powerpc_nvram_storage *nv)
 
        rc = process_run_sync(process);
 
-       if (rc || !WIFEXITED(process->exit_status)
-                       || WEXITSTATUS(process->exit_status)) {
+       if (rc || !process_exit_ok(process)) {
                fprintf(stderr, "nvram process returned "
                                "non-zero exit status\n");
                rc = -1;
@@ -183,8 +182,7 @@ static int write_nvram(struct powerpc_nvram_storage *nv)
 
                talloc_free(paramstr);
 
-               if (rc || !WIFEXITED(process->exit_status)
-                               || WEXITSTATUS(process->exit_status)) {
+               if (rc || !process_exit_ok(process)) {
                        rc = -1;
                        pb_log("nvram update process returned "
                                        "non-zero exit status\n");