fix
authorMiklos Szeredi <miklos@szeredi.hu>
Tue, 9 Nov 2004 15:40:23 +0000 (15:40 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Tue, 9 Nov 2004 15:40:23 +0000 (15:40 +0000)
lufis/ChangeLog
lufis/Makefile
lufis/dircache.c

index 6b4b644643f6518498cc954a957e675704f55dec..d3256b4cded0857961ca3e461b1b850183899602 100644 (file)
@@ -1,3 +1,7 @@
+2004-10-09  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Fix compilation with post 1.9 FUSE
+
 2004-03-09  Miklos Szeredi <miklos@szeredi.hu>
 
        * Make it possible to mount captivefs filesystem
index 713e5097020fa021d6bd80588f3c8ed425e91b68..5ff039297d61e2ced933d4fbd6f347d5619dfedc 100644 (file)
@@ -1,6 +1,17 @@
 CC = gcc
-CFLAGS = -Wall -W -g
-LDLIBS = -lfuse -lpthread -ldl -rdynamic
+
+CFLAGS := -Wall -W -g 
+LDLIBS := -lpthread -ldl -rdynamic
+
+PKGCONFIG := env PKG_CONFIG_PATH=/usr/local/lib/pkgconfig pkg-config
+FUSEVER := $(shell $(PKGCONFIG) --modversion fuse 2> /dev/null)
+ifeq ($(FUSEVER),)
+       LDLIBS += -lfuse
+else
+       CFLAGS += $(shell $(PKGCONFIG) --cflags fuse)
+       LDLIBS += $(shell $(PKGCONFIG) --libs fuse)
+endif
+
 CPPFLAGS := -D_FILE_OFFSET_BITS=64
 #CPPFLAGS += -DDEBUG
 
index 0498355fd1dfaa04343fb42a2879a7db0177c03a..bdd871745503718a0e2a94224c15ed9dfb16809c 100644 (file)
@@ -305,7 +305,11 @@ int lu_cache_readdir(struct dir_cache *cache, char *dir,
     
     list_for_each(p, &d->d_entries){
         de = list_entry(p, struct direntry, e_list);
+#if FUSE_MAJOR_VERSION < 2 || (FUSE_MAJOR_VERSION == 2 && FUSE_MINOR_VERSION < 1)
         filler(h, de->e_name, 0);
+#else
+        filler(h, de->e_name, 0, 0);
+#endif
     }
 
     d->d_stamp = time(NULL);