Return a predictable return code from re-exec

Instead of returning the direct error code from the system() call to
re-exec swupd update, return a predictable 0 or 1. System was previously
returning 255 (out of range) when failing to re-exec swupd.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
This commit is contained in:
Matthew Johnson
2017-08-10 15:33:59 -07:00
parent 286eb6fe2d
commit 05930d60ec
+7 -3
View File
@@ -218,16 +218,20 @@ static int re_exec_update(bool versions_match)
{
if (!versions_match) {
fprintf(stderr, "ERROR: Inconsistency between version files, exiting now.\n");
return -1;
return 1;
}
if (!swupd_cmd) {
fprintf(stderr, "ERROR: Unable to determine re-update command, exiting now.\n");
return -1;
return 1;
}
/* Run the swupd_cmd saved from main */
return system(swupd_cmd);
if (system(swupd_cmd) != 0) {
return 1;
}
return 0;
}
int main_update()