Skip to content

Commit

Permalink
meson: handle fuse versions with buggy dt_type handling
Browse files Browse the repository at this point in the history
Link: libfuse/libfuse#591
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner (Microsoft) committed Mar 13, 2022
1 parent 6dc6057 commit 1979107
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,17 @@ libfuse = dependency('fuse3', required: false)
if libfuse.found()
conf.set10('HAVE_FUSE3', true)
conf.set('FUSE_USE_VERSION', 35)
if libfuse.version().version_compare('>=3.10.3')
conf.set10('HAVE_FUSE_RETURNS_DT_TYPE', true)
else
conf.set10('HAVE_FUSE_RETURNS_DT_TYPE', false)
endif
else
libfuse = dependency('fuse', version: '>= 2.6')
if libfuse.found()
conf.set10('HAVE_FUSE', true)
conf.set('FUSE_USE_VERSION', 26)
conf.set10('HAVE_FUSE_RETURNS_DT_TYPE', false)
endif
endif

Expand Down
2 changes: 2 additions & 0 deletions src/bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,9 @@ static void __attribute__((destructor)) lxcfs_exit(void)
void *lxcfs_fuse_init(struct fuse_conn_info *conn, void *data)
{
struct fuse_context *fc = fuse_get_context();
#if HAVE_FUSE_RETURNS_DT_TYPE
can_use_sys_cpu = true;
#endif
has_versioned_opts = true;
return fc->private_data;
}

0 comments on commit 1979107

Please sign in to comment.