fix
authorMiklos Szeredi <miklos@szeredi.hu>
Thu, 11 Aug 2005 15:48:10 +0000 (15:48 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Thu, 11 Aug 2005 15:48:10 +0000 (15:48 +0000)
example/fusexmp_fh.c
include/fuse.h
include/fuse_common.h
kernel/fuse_i.h

index 8a40c9e6bf2d62abcdf5b649c748860de2878f0f..432ff6f06c0b43c07d67bea796d6acde940e09da 100644 (file)
@@ -8,10 +8,7 @@
 
 #include <config.h>
 
-#ifdef linux
-/* For pread()/pwrite() */
-#define _XOPEN_SOURCE 500
-#endif
+#define _GNU_SOURCE
 
 #include <fuse.h>
 #include <stdio.h>
@@ -210,13 +207,13 @@ static int xmp_utime(const char *path, struct utimbuf *buf)
 
 static int xmp_open(const char *path, struct fuse_file_info *fi)
 {
-    int res;
+    int fd;
 
-    res = open(path, fi->flags);
-    if(res == -1)
+    fd = open(path, fi->flags);
+    if(fd == -1)
         return -errno;
 
-    fi->fh = res;
+    fi->fh = fd;
     return 0;
 }
 
index ade49f57c2579b72c83084e08bdfd1cb100a96e8..ca960847d892d9a4aadcab8a429ea3a6ac9bdae8 100644 (file)
    new application), to use the old API define it to 21 (this is the
    default), to use the even older 1.X API define it to 11. */
 
-#ifndef FUSE_USE_VERSION
-#define FUSE_USE_VERSION 21
-#endif
-
-/** Major version of FUSE library interface */
-#define FUSE_MAJOR_VERSION 2
-
-/** Minor version of FUSE library interface */
-#define FUSE_MINOR_VERSION 4
-
-/* This interface uses 64 bit off_t */
-#if _FILE_OFFSET_BITS != 64
-#error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
-#endif
-
 #include "fuse_common.h"
 
 #include <sys/types.h>
index bb120d2fdcbf976cfa05975c77c8ab45bb9318c3..648d6e470e4f093891f60b72d4f5471ee734fe37 100644 (file)
 #ifndef _FUSE_COMMON_H_
 #define _FUSE_COMMON_H_
 
+#ifndef FUSE_USE_VERSION
+#define FUSE_USE_VERSION 21
+#endif
+
+/** Major version of FUSE library interface */
+#define FUSE_MAJOR_VERSION 2
+
+/** Minor version of FUSE library interface */
+#define FUSE_MINOR_VERSION 4
+
+#define FUSE_MAKE_VERSION(maj, min)  ((maj) * 10 + (min))
+#define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION)
+
+/* This interface uses 64 bit off_t */
+#if _FILE_OFFSET_BITS != 64
+#error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
+#endif
+
 /** Information about open files */
 struct fuse_file_info {
     /** Open flags.  Available in open() and release() */
index cf990fbd340309d476953d008c8af1f59210bb2e..08c6debe50e98695163da9aecc5ab4bbfbe72c06 100644 (file)
@@ -337,7 +337,7 @@ struct fuse_conn {
        /** Are file locking primitives not implemented by fs? */
        unsigned no_lk : 1;
 
-       /** Is access not implemented by fs */
+       /** Is access not implemented by fs? */
        unsigned no_access : 1;
 
 #ifdef KERNEL_2_6