aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorGravatar Przemyslaw Pawelczyk <przemoc@gmail.com>2016-11-28 14:48:10 +0100
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-11-28 21:35:05 -0800
commit237c5c1cb5b19020d422cd8b6d36269b14f15cc5 (patch)
tree3b98520772aa48bb7590b1725472e16f25eeb77a /example
parenta3fda25b7d2205094241c48e368a383c25920512 (diff)
examples/passthrough_ll.c: Close root fd before application ends.
If we want to do, what system would do anyway upon program termination, then let's try to be a bit more scrupulous.
Diffstat (limited to 'example')
-rw-r--r--example/passthrough_ll.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/example/passthrough_ll.c b/example/passthrough_ll.c
index 9c6144a..32e4ff6 100644
--- a/example/passthrough_ll.c
+++ b/example/passthrough_ll.c
@@ -464,6 +464,7 @@ int main(int argc, char *argv[])
int ret = -1;
lo.root.next = lo.root.prev = &lo.root;
+ lo.root.fd = -1;
if (fuse_parse_cmdline(&args, &opts) != 0)
return 1;
@@ -515,6 +516,8 @@ err_out1:
while (lo.root.next != &lo.root)
lo_free(lo.root.next);
+ if (lo.root.fd >= 0)
+ close(lo.root.fd);
return ret ? 1 : 0;
}