mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-17 11:15:12 -04:00
Merge pull request #90 from giuseppe/fix-ubuntu-build
build: fix build with older versions of libfuse
This commit is contained in:
commit
d99d8684c0
23
configure.ac
23
configure.ac
@ -32,6 +32,29 @@ AC_DEFINE([USE_DIFF_HASH], 1, [Use the same hashing function as GNU diff])
|
|||||||
|
|
||||||
PKG_CHECK_MODULES([FUSE], [fuse3 >= 3.2.1], [AC_DEFINE([HAVE_FUSE], 1, [Define if libfuse is available])], [AC_MSG_ERROR([*** libfuse not found])]])
|
PKG_CHECK_MODULES([FUSE], [fuse3 >= 3.2.1], [AC_DEFINE([HAVE_FUSE], 1, [Define if libfuse is available])], [AC_MSG_ERROR([*** libfuse not found])]])
|
||||||
|
|
||||||
|
old_CFLAGS=$CFLAGS
|
||||||
|
old_LDFLAGS=$LDFLAGS
|
||||||
|
CFLAGS=$pkg_cv_FUSE_CFLAGS
|
||||||
|
LDFLAGS=$pkg_cv_FUSE_LDFLAGS
|
||||||
|
AC_COMPILE_IFELSE(
|
||||||
|
[
|
||||||
|
AC_LANG_SOURCE([
|
||||||
|
#define FUSE_USE_VERSION 32
|
||||||
|
#include <fuse_lowlevel.h>
|
||||||
|
void foo()
|
||||||
|
{
|
||||||
|
struct fuse_file_info fi;
|
||||||
|
fi.cache_readdir = 1;
|
||||||
|
}])
|
||||||
|
],
|
||||||
|
[cache_readdir=1],
|
||||||
|
[cache_readdir=0])
|
||||||
|
CFLAGS=$old_CFLAGS
|
||||||
|
LDFLAGS=$old_LDFLAGS
|
||||||
|
|
||||||
|
AC_DEFINE_UNQUOTED([HAVE_FUSE_CACHE_READDIR], $cache_readdir, [Define if libfuse is available])
|
||||||
|
|
||||||
|
|
||||||
AC_FUNC_ERROR_AT_LINE
|
AC_FUNC_ERROR_AT_LINE
|
||||||
AC_FUNC_MALLOC
|
AC_FUNC_MALLOC
|
||||||
AC_CHECK_FUNCS([open_by_handle_at error memset strdup copy_file_range])
|
AC_CHECK_FUNCS([open_by_handle_at error memset strdup copy_file_range])
|
||||||
|
2
main.c
2
main.c
@ -1744,7 +1744,9 @@ ovl_opendir (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
|
|||||||
if (get_timeout (lo) > 0)
|
if (get_timeout (lo) > 0)
|
||||||
{
|
{
|
||||||
fi->keep_cache = 1;
|
fi->keep_cache = 1;
|
||||||
|
#if HAVE_FUSE_CACHE_READDIR
|
||||||
fi->cache_readdir = 1;
|
fi->cache_readdir = 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
fuse_reply_open (req, fi);
|
fuse_reply_open (req, fi);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user