aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <mszeredi@suse.cz>2013-08-26 11:33:33 +0200
committerGravatar Miklos Szeredi <mszeredi@suse.cz>2013-08-26 11:33:33 +0200
commitf4bb7265fddf8c7e1f186d53f1e07fdccfbe8d00 (patch)
tree35cb28b0a3946730394ef2fcb4a28be179249fb0
parent46f1ac6c1a280706aa290bcc60349eb5f843cf17 (diff)
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).
-rwxr-xr-xlib/fuse_lowlevel.c4
1 files changed, 3 insertions, 1 deletions
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);
}