summaryrefslogtreecommitdiffstats
path: root/fuse/fuse_kern_chan.c
diff options
context:
space:
mode:
Diffstat (limited to 'fuse/fuse_kern_chan.c')
-rw-r--r--fuse/fuse_kern_chan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fuse/fuse_kern_chan.c b/fuse/fuse_kern_chan.c
index 5f77bbf56..4a9beb8f8 100644
--- a/fuse/fuse_kern_chan.c
+++ b/fuse/fuse_kern_chan.c
@@ -77,7 +77,10 @@ static int fuse_kern_chan_send(struct fuse_chan *ch, const struct iovec iov[],
static void fuse_kern_chan_destroy(struct fuse_chan *ch)
{
- close(fuse_chan_fd(ch));
+ int fd = fuse_chan_fd(ch);
+
+ if (fd != -1)
+ close(fd);
}
#define MIN_BUFSIZE 0x21000