projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'github/pr/1879'
[collectd.git]
/
src
/
daemon
/
common.c
diff --git
a/src/daemon/common.c
b/src/daemon/common.c
index
1450352
..
05b1199
100644
(file)
--- a/
src/daemon/common.c
+++ b/
src/daemon/common.c
@@
-1572,8
+1572,6
@@
void set_sock_opts (int sockfd) /* {{{ */
socklen_t socklen = sizeof (socklen_t);
int so_keepalive = 1;
socklen_t socklen = sizeof (socklen_t);
int so_keepalive = 1;
- int tcp_keepidle = ((CDTIME_T_TO_MS(plugin_get_interval()) - 1) / 100 + 1);
- int tcp_keepintvl = ((CDTIME_T_TO_MS(plugin_get_interval()) - 1) / 1000 + 1);
status = getsockopt (sockfd, SOL_SOCKET, SO_TYPE, &socktype, &socklen);
if (status != 0)
status = getsockopt (sockfd, SOL_SOCKET, SO_TYPE, &socktype, &socklen);
if (status != 0)
@@
-1590,6
+1588,7
@@
void set_sock_opts (int sockfd) /* {{{ */
WARNING ("set_sock_opts: failed to set socket keepalive flag");
#ifdef TCP_KEEPIDLE
WARNING ("set_sock_opts: failed to set socket keepalive flag");
#ifdef TCP_KEEPIDLE
+ int tcp_keepidle = ((CDTIME_T_TO_MS(plugin_get_interval()) - 1) / 100 + 1);
status = setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE,
&tcp_keepidle, sizeof (tcp_keepidle));
if (status != 0)
status = setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE,
&tcp_keepidle, sizeof (tcp_keepidle));
if (status != 0)
@@
-1597,6
+1596,7
@@
void set_sock_opts (int sockfd) /* {{{ */
#endif
#ifdef TCP_KEEPINTVL
#endif
#ifdef TCP_KEEPINTVL
+ int tcp_keepintvl = ((CDTIME_T_TO_MS(plugin_get_interval()) - 1) / 1000 + 1);
status = setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL,
&tcp_keepintvl, sizeof (tcp_keepintvl));
if (status != 0)
status = setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL,
&tcp_keepintvl, sizeof (tcp_keepintvl));
if (status != 0)
@@
-1677,14
+1677,14
@@
void strarray_free (char **array, size_t array_len) /* {{{ */
int check_capability (int capability) /* {{{ */
{
#ifdef _LINUX_CAPABILITY_VERSION_3
int check_capability (int capability) /* {{{ */
{
#ifdef _LINUX_CAPABILITY_VERSION_3
- cap_user_header_t cap_header = calloc(
sizeof (*cap_header), 1
);
+ cap_user_header_t cap_header = calloc(
1, sizeof (*cap_header)
);
if (cap_header == NULL)
{
ERROR("check_capability: calloc failed");
return (-1);
}
if (cap_header == NULL)
{
ERROR("check_capability: calloc failed");
return (-1);
}
- cap_user_data_t cap_data = calloc(
sizeof (*cap_data), 1
);
+ cap_user_data_t cap_data = calloc(
1, sizeof (*cap_data)
);
if (cap_data == NULL)
{
ERROR("check_capability: calloc failed");
if (cap_data == NULL)
{
ERROR("check_capability: calloc failed");