In this case the statx() is use to get mount ID. It's optional and not
required. Let's #ifdef the statx() call and also check for stx_mnt_id
struct member.
Fixes: https://github.com/util-linux/util-linux/issues/2415
Signed-off-by: Karel Zak <kzak@redhat.com>
[[#include <termios.h>]])
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
- [#include <sys/stat.h>])
+ [[#include <sys/stat.h>]])
+
+AC_CHECK_MEMBERS([struct statx.stx_mnt_id],,,
+ [[#include <linux/stat.h>]])
AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]])
/* cleanup after fail (libmount may only try the FS type) */
close_sysapi_fds(api);
+#if defined(HAVE_STRUCT_STATX) && defined(HAVE_STRUCT_STATX_STX_MNT_ID)
if (!rc && cxt->fs) {
struct statx st;
fs->id = cxt->fs->id;
}
}
+#endif
done:
DBG(HOOK, ul_debugobj(hs, "create FS done [rc=%d, id=%d]", rc, cxt->fs ? cxt->fs->id : -1));