mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-09-07 14:11:52 +00:00
verifytime: Fix return value of verify_time function
There was some confusion about shell return code and bools. Shell returns 0 for true and bools are 0 for false. Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit is contained in:
+3
-3
@@ -87,7 +87,7 @@ bool verify_time()
|
||||
|
||||
versionstamp = get_versionstamp();
|
||||
if (versionstamp == 0) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
time_t versiontime = (time_t)versionstamp;
|
||||
|
||||
@@ -98,9 +98,9 @@ bool verify_time()
|
||||
* The system time wasn't sane, so set it here and try again */
|
||||
fprintf(stderr, "Warning: Current time is %s\nAttempting to fix...", asctime(timeinfo));
|
||||
if (set_time(versiontime) == false) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -20,5 +20,9 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
return verify_time() ? 1 : 0;
|
||||
if (verify_time()) {
|
||||
return 0; // Success
|
||||
}
|
||||
|
||||
return 1; // Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user