mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-10-03 23:38:25 +00:00
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:
+7
-3
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user