]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
gpt-auto-generator: fix warnings about unused func when !ENABLE_EFI
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 31 Jul 2023 12:04:55 +0000 (14:04 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 31 Jul 2023 12:04:55 +0000 (14:04 +0200)
src/gpt-auto-generator/gpt-auto-generator.c

index 585aaae2ede8e0fc227c67cfff481719395d97a4..fed670e7f4ab5fb774e9ec7a74beda7b13279df6 100644 (file)
@@ -487,33 +487,6 @@ static int slash_boot_in_fstab(void) {
         return cache;
 }
 
-static int slash_efi_in_fstab(void) {
-        static int cache = -1;
-
-        if (cache >= 0)
-                return cache;
-
-        cache = fstab_is_mount_point("/efi");
-        if (cache < 0)
-                return log_error_errno(cache, "Failed to parse fstab: %m");
-        return cache;
-}
-
-static bool slash_boot_exists(void) {
-        static int cache = -1;
-
-        if (cache >= 0)
-                return cache;
-
-        if (access("/boot", F_OK) >= 0)
-                return (cache = true);
-        if (errno != ENOENT)
-                log_error_errno(errno, "Failed to determine whether /boot/ exists, assuming no: %m");
-        else
-                log_debug_errno(errno, "/boot/: %m");
-        return (cache = false);
-}
-
 static int add_partition_xbootldr(DissectedPartition *p) {
         _cleanup_free_ char *options = NULL;
         int r;
@@ -562,6 +535,33 @@ static int add_partition_xbootldr(DissectedPartition *p) {
 }
 
 #if ENABLE_EFI
+static int slash_efi_in_fstab(void) {
+        static int cache = -1;
+
+        if (cache >= 0)
+                return cache;
+
+        cache = fstab_is_mount_point("/efi");
+        if (cache < 0)
+                return log_error_errno(cache, "Failed to parse fstab: %m");
+        return cache;
+}
+
+static bool slash_boot_exists(void) {
+        static int cache = -1;
+
+        if (cache >= 0)
+                return cache;
+
+        if (access("/boot", F_OK) >= 0)
+                return (cache = true);
+        if (errno != ENOENT)
+                log_error_errno(errno, "Failed to determine whether /boot/ exists, assuming no: %m");
+        else
+                log_debug_errno(errno, "/boot/: %m");
+        return (cache = false);
+}
+
 static int add_partition_esp(DissectedPartition *p, bool has_xbootldr) {
         const char *esp_path = NULL, *id = NULL;
         _cleanup_free_ char *options = NULL;