summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-03-09 18:21:42 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2016-03-09 18:21:42 +0100
commitbd7e03af007c4e857ed0370eba9e903d6b561937 (patch)
tree23b7f66162ff1a45d29c5a03fe74c381ffec0ef3 /src/shared
parent280d397ab313b647fbd824d1cb58eb8323c74501 (diff)
parent58015d7815bce405c7c0ac082d8c2f407ec07eeb (diff)
Merge pull request #2755 from keszybz/more-tests
Enable more tests by default, and even more with `--enable-tests=unsafe`
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/acpi-fpdt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shared/acpi-fpdt.c b/src/shared/acpi-fpdt.c
index 3cb9e781fd..6779691c28 100644
--- a/src/shared/acpi-fpdt.c
+++ b/src/shared/acpi-fpdt.c
@@ -119,7 +119,7 @@ int acpi_get_boot_usec(usec_t *loader_start, usec_t *loader_exit) {
}
if (ptr == 0)
- return -EINVAL;
+ return -ENODATA;
/* read Firmware Basic Boot Performance Data Record */
fd = open("/dev/mem", O_CLOEXEC|O_RDONLY);
@@ -146,6 +146,10 @@ int acpi_get_boot_usec(usec_t *loader_start, usec_t *loader_exit) {
if (brec.type != ACPI_FPDT_BOOT_REC)
return -EINVAL;
+ if (brec.exit_services_exit == 0)
+ /* Non-UEFI compatible boot. */
+ return -ENODATA;
+
if (brec.startup_start == 0 || brec.exit_services_exit < brec.startup_start)
return -EINVAL;
if (brec.exit_services_exit > NSEC_PER_HOUR)