]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: use __unused__ for dummy get_mnt_id()
authorKarel Zak <kzak@redhat.com>
Wed, 21 Aug 2024 08:56:50 +0000 (10:56 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 8 Jan 2025 12:57:43 +0000 (13:57 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/utils.c

index 7d8116402a1c21ddc1e708fe93be9bbcbc868338..a090373728bb910bc442350cf76777d386c88699 100644 (file)
@@ -266,10 +266,10 @@ int mnt_is_readonly(const char *path)
        return 0;
 }
 
+#if defined(HAVE_STATX) && defined(HAVE_STRUCT_STATX) && defined(HAVE_STRUCT_STATX_STX_MNT_ID)
 static int get_mnt_id( int fd, const char *path,
                        uint64_t *uniq_id, int *id)
 {
-#if defined(HAVE_STATX) && defined(HAVE_STRUCT_STATX) && defined(HAVE_STRUCT_STATX_STX_MNT_ID)
        int rc;
        struct statx sx = { 0 };
        int flags = AT_STATX_DONT_SYNC | AT_NO_AUTOMOUNT;
@@ -300,10 +300,16 @@ static int get_mnt_id(    int fd, const char *path,
 # endif
        }
        return 0;
-#else
+}
+#else /* HAVE_STATX && HAVE_STRUCT_STATX && AVE_STRUCT_STATX_STX_MNT_ID */
+static int get_mnt_id( int fd __attribute__((__unused__)),
+                       const char *path __attribute__((__unused__)),
+                       uint64_t *uniq_id __attribute__((__unused__)),
+                       int *id __attribute__((__unused__)))
+{
        return -ENOSYS;
-#endif
 }
+#endif
 
 int mnt_id_from_fd(int fd, uint64_t *uniq_id, int *id)
 {