From f6e0ec6e2df64ce90e3a52a3e636f3ffb5c38927 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 3 Aug 2005 09:11:06 +0000 Subject: fix --- example/null.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'example/null.c') diff --git a/example/null.c b/example/null.c index d58feab..d9539ab 100644 --- a/example/null.c +++ b/example/null.c @@ -12,8 +12,6 @@ #include #include -#define UNUSED(x) x __attribute__((unused)) - static int null_getattr(const char *path, struct stat *stbuf) { if(strcmp(path, "/") != 0) @@ -30,34 +28,46 @@ static int null_getattr(const char *path, struct stat *stbuf) return 0; } -static int null_truncate(const char *path, off_t UNUSED(size)) +static int null_truncate(const char *path, off_t size) { + (void) size; + if(strcmp(path, "/") != 0) return -ENOENT; return 0; } -static int null_open(const char *path, struct fuse_file_info *UNUSED(fi)) +static int null_open(const char *path, struct fuse_file_info *fi) { + (void) fi; + if(strcmp(path, "/") != 0) return -ENOENT; return 0; } -static int null_read(const char *path, char *UNUSED(buf), size_t size, - off_t UNUSED(offset), struct fuse_file_info *UNUSED(fi)) +static int null_read(const char *path, char *buf, size_t size, + off_t offset, struct fuse_file_info *fi) { + (void) buf; + (void) offset; + (void) fi; + if(strcmp(path, "/") != 0) return -ENOENT; return size; } -static int null_write(const char *path, const char *UNUSED(buf), size_t size, - off_t UNUSED(offset), struct fuse_file_info *UNUSED(fi)) +static int null_write(const char *path, const char *buf, size_t size, + off_t offset, struct fuse_file_info *fi) { + (void) buf; + (void) offset; + (void) fi; + if(strcmp(path, "/") != 0) return -ENOENT; -- cgit v1.2.3