]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hibernate-resume-config: apply ENABLE_EFI ifdef correctly
authorMike Yuan <me@yhndnzj.com>
Mon, 8 Apr 2024 20:04:21 +0000 (04:04 +0800)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 9 Apr 2024 07:40:21 +0000 (09:40 +0200)
Currently, validate_efi_hibernate_location is
fully conditioned out if !ENABLE_EFI, but
get_efi_hibernate_location() still calls it.

src/hibernate-resume/hibernate-resume-config.c

index 504d27a3963159b5d8a9c40b233a8c5316db9b00..c7ed1bc8d73682b6e25e3b98bef772de9080d49c 100644 (file)
@@ -140,7 +140,7 @@ static bool validate_efi_hibernate_location(EFIHibernateLocation *e) {
 #endif
 
 int get_efi_hibernate_location(EFIHibernateLocation **ret) {
-
+#if ENABLE_EFI
         static const JsonDispatch dispatch_table[] = {
                 { "uuid",                  JSON_VARIANT_STRING,        json_dispatch_id128,  offsetof(EFIHibernateLocation, uuid),           JSON_MANDATORY             },
                 { "offset",                _JSON_VARIANT_TYPE_INVALID, json_dispatch_uint64, offsetof(EFIHibernateLocation, offset),         JSON_MANDATORY             },
@@ -200,6 +200,7 @@ int get_efi_hibernate_location(EFIHibernateLocation **ret) {
         return 1;
 
 skip:
+#endif
         if (ret)
                 *ret = NULL;
         return 0;