]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fuse: fix fuse_getgroups detection
authorNoah Watkins <noahwatkins@gmail.com>
Sat, 20 Jul 2013 18:10:24 +0000 (11:10 -0700)
committerSage Weil <sage@inktank.com>
Mon, 22 Jul 2013 03:00:28 +0000 (20:00 -0700)
The ac_check_func fails because -lfuse is not in LIBS. This also enables
code that wasn't being compiled, and fixes compiler errors that
resulted.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>
configure.ac
src/client/fuse_ll.cc

index bdcf4fc557bb11d1f2abaf237d72f8b9ede5d160..bb03ad5b76f92195d1d1941dd88a9bb446909578 100644 (file)
@@ -250,7 +250,10 @@ AS_IF([test "x$with_fuse" != xno],
                          [Define if you have fuse])
                HAVE_LIBFUSE=1
               # look for fuse_getgroups and define FUSE_GETGROUPS if found
+           LIBS_saved="$LIBS"
+           LIBS="$LIBS -lfuse"
               AC_CHECK_FUNCS([fuse_getgroups])
+           LIBS="$LIBS_saved"
               ],
              [AC_MSG_FAILURE(
                    [no FUSE found (use --without-fuse to disable)])])])
index 83395534d0dc09a7f2a6a56735c6262ab28caafd..ce0c6de126051f02054b3629c4437e5295cfedd8 100644 (file)
@@ -14,6 +14,7 @@
 
 #define FUSE_USE_VERSION 26
 
+#include <fuse/fuse.h>
 #include <fuse/fuse_lowlevel.h>
 #include <signal.h>
 #include <stdio.h>
@@ -520,7 +521,7 @@ static int getgroups_cb(void *handle, uid_t uid, gid_t **sgids)
     return 0;
   }
 
-  *sgids = malloc(c*sizeof(**sgids));
+  *sgids = (gid_t*)malloc(c*sizeof(**sgids));
   if (!*sgids) {
     return -ENOMEM;
   }