From ba8ec88e0e194f2dc5928b043ee8a5a2d338afe9 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 21 Dec 2001 09:28:33 +0000 Subject: [PATCH] minor fixes --- configure.in | 2 +- example/hello.c | 15 ++++++++------- README.python => python/README | 0 3 files changed, 9 insertions(+), 8 deletions(-) rename README.python => python/README (100%) diff --git a/configure.in b/configure.in index 6a0b1bd..a6f94c8 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ AC_INIT(lib/fuse.c) -AM_INIT_AUTOMAKE(fuse, 0.9) +AM_INIT_AUTOMAKE(fuse, 0.95) AM_CONFIG_HEADER(include/config.h) AC_PROG_CC diff --git a/example/hello.c b/example/hello.c index 5cf75f4..e0010cd 100644 --- a/example/hello.c +++ b/example/hello.c @@ -12,6 +12,7 @@ #include static const char *hello_str = "Hello World!\n"; +static const char *hello_path = "/hello"; static int hello_getattr(const char *path, struct stat *stbuf) { @@ -22,8 +23,8 @@ static int hello_getattr(const char *path, struct stat *stbuf) stbuf->st_mode = S_IFDIR | 0755; stbuf->st_nlink = 2; } - else if(strcmp(path, "/hello") == 0) { - stbuf->st_mode = S_IFREG | 0644; + else if(strcmp(path, hello_path) == 0) { + stbuf->st_mode = S_IFREG | 0444; stbuf->st_nlink = 1; stbuf->st_size = strlen(hello_str); } @@ -40,14 +41,14 @@ static int hello_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler) filler(h, ".", 0); filler(h, "..", 0); - filler(h, "hello", 0); + filler(h, hello_path + 1, 0); return 0; } static int hello_open(const char *path, int flags) { - if(strcmp(path, "/hello") != 0) + if(strcmp(path, hello_path) != 0) return -ENOENT; if((flags & 3) != O_RDONLY) @@ -58,14 +59,14 @@ static int hello_open(const char *path, int flags) static int hello_read(const char *path, char *buf, size_t size, off_t offset) { - if(strcmp(path, "/hello") != 0) + if(strcmp(path, hello_path) != 0) return -ENOENT; memcpy(buf, hello_str + offset, size); return size; } -static struct fuse_operations null_oper = { +static struct fuse_operations hello_oper = { getattr: hello_getattr, readlink: NULL, getdir: hello_getdir, @@ -87,6 +88,6 @@ static struct fuse_operations null_oper = { int main(int argc, char *argv[]) { - fuse_main(argc, argv, &null_oper); + fuse_main(argc, argv, &hello_oper); return 0; } diff --git a/README.python b/python/README similarity index 100% rename from README.python rename to python/README -- 2.30.2