diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2017-04-07 16:27:33 -0700 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2017-04-07 16:40:15 -0700 |
commit | db1c6adb18950c188fbf20247245eef11ad47b30 (patch) | |
tree | 0704b07d8af60504105624e62947264358d23b97 /example | |
parent | f7c5d10ce529d1e131113e155e3321d1fda1ebc2 (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.c | 7 |
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; } |