projects
/
qemu-gpiodev
/
libfuse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ddfd2d4
)
libfuse: don't close fd if it's -1
author
Miklos Szeredi
<mszeredi@suse.cz>
Mon, 1 Jul 2013 08:18:49 +0000
(10:18 +0200)
committer
Miklos Szeredi
<mszeredi@suse.cz>
Mon, 1 Jul 2013 08:18:49 +0000
(10:18 +0200)
This prevents a valgrind warning.
lib/fuse_kern_chan.c
patch
|
blob
|
history
diff --git
a/lib/fuse_kern_chan.c
b/lib/fuse_kern_chan.c
index 5f77bbf5628d443feb8c7792ea85f18c7bf228bc..4a9beb8f8dfe5b94d6cdb1c8d7db8509d2ddc090 100644
(file)
--- a/
lib/fuse_kern_chan.c
+++ b/
lib/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