projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b158267
)
gmond plugin: Check return value of setsockopt(2).
author
Florian Forster
<octo@collectd.org>
Thu, 17 Dec 2015 13:21:27 +0000
(14:21 +0100)
committer
Florian Forster
<octo@collectd.org>
Thu, 17 Dec 2015 13:22:29 +0000
(14:22 +0100)
CID: 38112
src/gmond.c
patch
|
blob
|
history
diff --git
a/src/gmond.c
b/src/gmond.c
index
a1fa9ea
..
99d1334
100644
(file)
--- a/
src/gmond.c
+++ b/
src/gmond.c
@@
-286,8
+286,14
@@
static int create_sockets (socket_entry_t **ret_sockets, /* {{{ */
{
int yes = 1;
- setsockopt (sockets[sockets_num].fd, SOL_SOCKET, SO_REUSEADDR,
+ s
tatus = s
etsockopt (sockets[sockets_num].fd, SOL_SOCKET, SO_REUSEADDR,
(void *) &yes, sizeof (yes));
+ if (status != 0)
+ {
+ char errbuf[1024];
+ WARNING ("gmond plugin: setsockopt(2) failed: %s",
+ sstrerror (errno, errbuf, sizeof (errbuf)));
+ }
}
status = bind (sockets[sockets_num].fd, ai_ptr->ai_addr, ai_ptr->ai_addrlen);