projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fcc889e
)
write_graphite plugin: Don't call close() on invalid file descriptors.
author
Florian Forster
<octo@collectd.org>
Sat, 13 Jul 2013 05:46:20 +0000
(07:46 +0200)
committer
Florian Forster
<octo@collectd.org>
Sat, 13 Jul 2013 05:46:20 +0000
(07:46 +0200)
src/write_graphite.c
patch
|
blob
|
history
diff --git
a/src/write_graphite.c
b/src/write_graphite.c
index
aa87896
..
bde5fb6
100644
(file)
--- a/
src/write_graphite.c
+++ b/
src/write_graphite.c
@@
-247,8
+247,11
@@
static void wg_callback_free (void *data)
wg_flush_nolock (/* timeout = */ 0, cb);
- close(cb->sock_fd);
- cb->sock_fd = -1;
+ if (cb->sock_fd >= 0)
+ {
+ close (cb->sock_fd);
+ cb->sock_fd = -1;
+ }
sfree(cb->node);
sfree(cb->service);