From: Karel Zak Date: Tue, 4 Oct 2022 09:59:52 +0000 (+0200) Subject: libmount: fix compilation without new API X-Git-Tag: v2.39-rc1~246 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d25e375a81dd5410377055e76f8818a201b117c3;p=thirdparty%2Futil-linux.git libmount: fix compilation without new API Signed-off-by: Karel Zak --- diff --git a/libmount/src/hook_mount.c b/libmount/src/hook_mount.c index 8d4e593d9a..7e0dd312f6 100644 --- a/libmount/src/hook_mount.c +++ b/libmount/src/hook_mount.c @@ -44,9 +44,10 @@ */ #include "mountP.h" - #include +#ifdef UL_HAVE_MOUNT_API + #define set_syscall_status(_cxt, _name, _x) __extension__ ({ \ if (!(_x)) { \ (_cxt)->syscall_status = -errno; \ @@ -522,3 +523,4 @@ const struct libmnt_hookset hookset_mount = .deinit = hookset_deinit }; +#endif /* UL_HAVE_MOUNT_API */ diff --git a/libmount/src/hooks.c b/libmount/src/hooks.c index b95e6c4263..ef52827692 100644 --- a/libmount/src/hooks.c +++ b/libmount/src/hooks.c @@ -39,7 +39,9 @@ static const struct libmnt_hookset *hooksets[] = #endif &hookset_mkdir, &hookset_subdir, +#ifdef UL_HAVE_MOUNT_API &hookset_mount, +#endif &hookset_mount_legacy, #ifdef UL_HAVE_MOUNT_API &hookset_idmap, diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c index dfef48fd08..d8fdc8f192 100644 --- a/libmount/src/optlist.c +++ b/libmount/src/optlist.c @@ -775,9 +775,9 @@ static inline uint64_t flag_to_attr(unsigned long flag) * Like mnt_optlist_get_flags() for VFS flags, but converts classic MS_* flags to * new MOUNT_ATTR_* */ +#ifdef UL_HAVE_MOUNT_API int mnt_optlist_get_attrs(struct libmnt_optlist *ls, uint64_t *set, uint64_t *clr) { -#ifdef UL_HAVE_MOUNT_API struct libmnt_iter itr; struct libmnt_opt *opt; @@ -809,10 +809,16 @@ int mnt_optlist_get_attrs(struct libmnt_optlist *ls, uint64_t *set, uint64_t *cl DBG(OPTLIST, ul_debugobj(ls, "return attrs set=0x%08" PRIx64 ", clr=0x%08" PRIx64, *set, *clr)); return 0; +} -#endif +#else +int mnt_optlist_get_attrs(struct libmnt_optlist *ls __attribute__((__unused__)), + uint64_t *set __attribute__((__unused__)), + uint64_t *clr __attribute__((__unused__))) +{ return 0; } +#endif /* UL_HAVE_MOUNT_API */ int mnt_optlist_strdup_optstr(struct libmnt_optlist *ls, char **optstr, const struct libmnt_optmap *map, unsigned int what)