aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2005-11-11 21:32:42 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2005-11-11 21:32:42 +0000
commit3a77047661e345939e36f761db7a7a04ae632b76 (patch)
tree96f7fb8e682473dbe9739357040d94f7d9a1d9c2 /example
parentbcc5385cc146c45bfe08e8351e3dcdd1d6354fee (diff)
fix
Diffstat (limited to 'example')
-rw-r--r--example/fusexmp_fh.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/example/fusexmp_fh.c b/example/fusexmp_fh.c
index 93bd843..491e691 100644
--- a/example/fusexmp_fh.c
+++ b/example/fusexmp_fh.c
@@ -79,10 +79,15 @@ static int xmp_opendir(const char *path, struct fuse_file_info *fi)
return 0;
}
+static inline DIR *get_dirp(struct fuse_file_info *fi)
+{
+ return (DIR *) (uintptr_t) fi->fh;
+}
+
static int xmp_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
off_t offset, struct fuse_file_info *fi)
{
- DIR *dp = (DIR *) fi->fh;
+ DIR *dp = get_dirp(fi);
struct dirent *de;
(void) path;
@@ -101,7 +106,7 @@ static int xmp_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
static int xmp_releasedir(const char *path, struct fuse_file_info *fi)
{
- DIR *dp = (DIR *) fi->fh;
+ DIR *dp = get_dirp(fi);
(void) path;
closedir(dp);
return 0;