diff --git a/configure.ac b/configure.ac index 979d8ccb..48d8949c 100644 --- a/configure.ac +++ b/configure.ac @@ -299,6 +299,10 @@ AS_IF([ test x$with_libmount != xno ], [ AC_DEFINE([HAVE_LIBMOUNT], 1, [Define if we have libmount.pc]) PKG_CHECK_MODULES(OT_DEP_LIBMOUNT, $LIBMOUNT_DEPENDENCY) with_libmount=yes + save_LIBS=$LIBS + LIBS=$OT_DEP_LIBMOUNT_LIBS + AC_CHECK_FUNCS(mnt_unref_cache) + LIBS=$save_LIBS ], [ with_libmount=no ]) diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 5a3f6d85..1cfe6ab1 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -1692,8 +1692,13 @@ is_ro_mount (const char *path) fs = mnt_table_find_target(tb, path, MNT_ITER_BACKWARD); is_mount = fs && mnt_fs_get_target (fs); - mnt_unref_cache (cache); +#ifdef HAVE_MNT_UNREF_CACHE mnt_unref_table (tb); + mnt_unref_cache (cache); +#else + mnt_free_table (tb); + mnt_free_cache (cache); +#endif if (!is_mount) return FALSE;