projects
/
qemu-gpiodev
/
libfuse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7c5d10
)
example/passthrough: close open files in release()
author
Nikolaus Rath
<Nikolaus@rath.org>
Fri, 7 Apr 2017 23:27:33 +0000
(16:27 -0700)
committer
Nikolaus Rath
<Nikolaus@rath.org>
Fri, 7 Apr 2017 23:40:15 +0000
(16:40 -0700)
That way we can use the file descriptor for other operations.
example/passthrough.c
patch
|
blob
|
history
diff --git
a/example/passthrough.c
b/example/passthrough.c
index 22e7083e6b20d876eaf7107f801d1a52633c8f05..55f770415a6f7d5332a9ed5bc30fca5106de3062 100644
(file)
--- 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;
}