From f4bb7265fddf8c7e1f186d53f1e07fdccfbe8d00 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 26 Aug 2013 11:33:33 +0200 Subject: Don't close -1 fd in fuse_chan_destroy() Valgrind warns on close(-1). So don't do this (happens if fuse_chan_clearfd() was called on the channel). --- lib/fuse_lowlevel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index c88b4a7..0f1c3d3 100755 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -224,7 +224,9 @@ static int fuse_chan_send(struct fuse_chan *ch, const struct iovec iov[], void fuse_chan_close(struct fuse_chan *ch) { - close(fuse_chan_fd(ch)); + int fd = fuse_chan_fd(ch); + if (fd != -1) + close(fd); } -- cgit v1.2.3