Skip to content

Commit

Permalink
test-boot-timestamp: Handle ERANGE error
Browse files Browse the repository at this point in the history
Timestampfs from sysfs files can be zero in which case ERANGE will
be returned so let's make sure we catch that.
  • Loading branch information
DaanDeMeyer committed Feb 13, 2023
1 parent ec96dad commit 0da4cc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/test/test-boot-timestamps.c
Expand Up @@ -16,7 +16,7 @@ static int test_acpi_fpdt(void) {

r = acpi_get_boot_usec(&loader_start, &loader_exit);
if (r < 0) {
bool ok = IN_SET(r, -ENOENT, -ENODATA) || ERRNO_IS_PRIVILEGE(r);
bool ok = IN_SET(r, -ENOENT, -ENODATA, -ERANGE) || ERRNO_IS_PRIVILEGE(r);

log_full_errno(ok ? LOG_DEBUG : LOG_ERR, r, "Failed to read ACPI FPDT: %m");
return ok ? 0 : r;
Expand Down

0 comments on commit 0da4cc9

Please sign in to comment.