aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2017-04-07 16:27:33 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2017-04-07 16:40:15 -0700
commitdb1c6adb18950c188fbf20247245eef11ad47b30 (patch)
tree0704b07d8af60504105624e62947264358d23b97 /example
parentf7c5d10ce529d1e131113e155e3321d1fda1ebc2 (diff)
example/passthrough: close open files in release()
That way we can use the file descriptor for other operations.
Diffstat (limited to 'example')
-rw-r--r--example/passthrough.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/example/passthrough.c b/example/passthrough.c
index 22e7083..55f7704 100644
--- a/example/passthrough.c
+++ b/example/passthrough.c
@@ -284,7 +284,7 @@ static int xmp_open(const char *path, struct fuse_file_info *fi)
if (res == -1)
return -errno;
- close(res);
+ fi->fh = res;
return 0;
}
@@ -339,11 +339,8 @@ static int xmp_statfs(const char *path, struct statvfs *stbuf)
static int xmp_release(const char *path, struct fuse_file_info *fi)
{
- /* Just a stub. This method is optional and can safely be left
- unimplemented */
-
(void) path;
- (void) fi;
+ close(fi->fh);
return 0;
}