From 237c5c1cb5b19020d422cd8b6d36269b14f15cc5 Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Mon, 28 Nov 2016 14:48:10 +0100 Subject: 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. --- example/passthrough_ll.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'example') 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; } -- cgit v1.2.3