diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-04-07 15:40:21 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2005-04-07 15:40:21 +0000 |
commit | ab9745641373d35235b8c0d124f1c355908b575f (patch) | |
tree | 4ad92b37432ff7dcbcdd0ba57b85dfe00f89c505 /example/fusexmp.c | |
parent | 670c78a3134f2233b018fa931e1a7e69e4ab11fd (diff) | |
download | libfuse-ab9745641373d35235b8c0d124f1c355908b575f.tar.gz |
fix
Diffstat (limited to 'example/fusexmp.c')
-rw-r--r-- | example/fusexmp.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/example/fusexmp.c b/example/fusexmp.c index 3230c36..95d26b3 100644 --- a/example/fusexmp.c +++ b/example/fusexmp.c @@ -49,24 +49,30 @@ static int xmp_readlink(const char *path, char *buf, size_t size) } -static int xmp_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler) +static int xmp_readdir(const char *path, void *buf, fuse_fill_dir_t filler, + off_t offset, struct fuse_file_info *fi) { DIR *dp; struct dirent *de; - int res = 0; + + (void) offset; + (void) fi; dp = opendir(path); if(dp == NULL) return -errno; while((de = readdir(dp)) != NULL) { - res = filler(h, de->d_name, de->d_type, de->d_ino); - if(res != 0) + struct stat st; + memset(&st, 0, sizeof(st)); + st.st_ino = de->d_ino; + st.st_mode = de->d_type << 12; + if (filler(buf, de->d_name, &st, 0)) break; } closedir(dp); - return res; + return 0; } static int xmp_mknod(const char *path, mode_t mode, dev_t rdev) @@ -314,7 +320,7 @@ static int xmp_removexattr(const char *path, const char *name) static struct fuse_operations xmp_oper = { .getattr = xmp_getattr, .readlink = xmp_readlink, - .getdir = xmp_getdir, + .readdir = xmp_readdir, .mknod = xmp_mknod, .mkdir = xmp_mkdir, .symlink = xmp_symlink, |