aboutsummaryrefslogtreecommitdiff
path: root/example/hello.c
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2007-03-30 16:32:12 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2007-03-30 16:32:12 +0000
commit4a709fc98ef77f15836b4920821e0ee606ac1d3d (patch)
treebcb542cc9c062d201f19a966d7bf2e2094b9440e /example/hello.c
parent2a53c580b730fd657af004bde995e1c2eefe6234 (diff)
cleanup
Diffstat (limited to 'example/hello.c')
-rw-r--r--example/hello.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/example/hello.c b/example/hello.c
index 7a1cdb5..0676a39 100644
--- a/example/hello.c
+++ b/example/hello.c
@@ -24,16 +24,14 @@ static int hello_getattr(const char *path, struct stat *stbuf)
int res = 0;
memset(stbuf, 0, sizeof(struct stat));
- if(strcmp(path, "/") == 0) {
+ if (strcmp(path, "/") == 0) {
stbuf->st_mode = S_IFDIR | 0755;
stbuf->st_nlink = 2;
- }
- else if(strcmp(path, hello_path) == 0) {
+ } else if (strcmp(path, hello_path) == 0) {
stbuf->st_mode = S_IFREG | 0444;
stbuf->st_nlink = 1;
stbuf->st_size = strlen(hello_str);
- }
- else
+ } else
res = -ENOENT;
return res;
@@ -45,7 +43,7 @@ static int hello_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
(void) offset;
(void) fi;
- if(strcmp(path, "/") != 0)
+ if (strcmp(path, "/") != 0)
return -ENOENT;
filler(buf, ".", NULL, 0);
@@ -57,10 +55,10 @@ static int hello_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
static int hello_open(const char *path, struct fuse_file_info *fi)
{
- if(strcmp(path, hello_path) != 0)
+ if (strcmp(path, hello_path) != 0)
return -ENOENT;
- if((fi->flags & 3) != O_RDONLY)
+ if ((fi->flags & 3) != O_RDONLY)
return -EACCES;
return 0;