Given that ERRNO_IS_NOT_SUPPORTED() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.
In this case the argument passed to ERRNO_IS_NOT_SUPPORTED() is the
value returned by efi_loader_get_entries() which is not expected to
return any positive values, but let's be consistent anyway and move
the ERRNO_IS_NOT_SUPPORTED() invocation to the branch where
the return value is known to be negative.
return 0;
r = efi_loader_get_entries(&m->efi_boot_loader_entries);
- if (r == -ENOENT || ERRNO_IS_NOT_SUPPORTED(r)) {
- log_debug_errno(r, "Boot loader reported no entries.");
- m->efi_boot_loader_entries_set = true;
- return 0;
- }
- if (r < 0)
+ if (r < 0) {
+ if (r == -ENOENT || ERRNO_IS_NOT_SUPPORTED(r)) {
+ log_debug_errno(r, "Boot loader reported no entries.");
+ m->efi_boot_loader_entries_set = true;
+ return 0;
+ }
return log_error_errno(r, "Failed to determine entries reported by boot loader: %m");
+ }
m->efi_boot_loader_entries_set = true;
return 1;