From db1c6adb18950c188fbf20247245eef11ad47b30 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Fri, 7 Apr 2017 16:27:33 -0700 Subject: example/passthrough: close open files in release() That way we can use the file descriptor for other operations. --- example/passthrough.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'example') 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; } -- cgit v1.2.3