From ef33030c1afb065fb6e96dae34a212a1ee428ca6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 21 Aug 2024 10:56:50 +0200 Subject: [PATCH] libmount: use __unused__ for dummy get_mnt_id() Signed-off-by: Karel Zak --- libmount/src/utils.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libmount/src/utils.c b/libmount/src/utils.c index 7d8116402..a09037372 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -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) { -- 2.47.2