projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.5' into collectd-5.6
[collectd.git]
/
src
/
chrony.c
diff --git
a/src/chrony.c
b/src/chrony.c
index
4a09753
..
f6294e4
100644
(file)
--- a/
src/chrony.c
+++ b/
src/chrony.c
@@
-26,6
+26,7
@@
*/
#include "collectd.h"
*/
#include "collectd.h"
+
#include "common.h" /* auxiliary functions */
#include "plugin.h" /* plugin_register_*, plugin_dispatch_values */
#include "common.h" /* auxiliary functions */
#include "plugin.h" /* plugin_register_*, plugin_dispatch_values */
@@
-306,14
+307,15
@@
static int
connect_client(const char *p_hostname,
const char *p_service, int p_family, int p_socktype)
{
connect_client(const char *p_hostname,
const char *p_service, int p_family, int p_socktype)
{
- struct addrinfo hints = { 0 };
- struct addrinfo *res = NULL, *ressave = NULL;
+ struct addrinfo *res, *ressave;
int n, sockfd;
int n, sockfd;
- hints.ai_family = p_family;
- hints.ai_socktype = p_socktype;
+ struct addrinfo ai_hints = {
+ .ai_family = p_family,
+ .ai_socktype = p_socktype
+ };
- n = getaddrinfo(p_hostname, p_service, &hints, &res);
+ n = getaddrinfo(p_hostname, p_service, &
ai_
hints, &res);
if (n < 0)
{
if (n < 0)
{
@@
-450,8
+452,8
@@
chrony_connect(void)
if (chrony_set_timeout())
{
if (chrony_set_timeout())
{
- ERROR(PLUGIN_NAME ": Error setting timeout to %lds. Errno = %d",
- g_chrony_timeout, errno);
+ ERROR(PLUGIN_NAME ": Error setting timeout to %l
l
ds. Errno = %d",
+
(long long)
g_chrony_timeout, errno);
return CHRONY_RC_FAIL;
}
return CHRONY_RC_OK;
return CHRONY_RC_FAIL;
}
return CHRONY_RC_OK;
@@
-1051,7
+1053,7
@@
chrony_read(void)
{
/* collectd read callback: Perform data acquisition */
int rc;
{
/* collectd read callback: Perform data acquisition */
int rc;
- unsigned int n
ow_src, n
_sources;
+ unsigned int n_sources;
if (g_chrony_seq_is_initialized == 0)
{
if (g_chrony_seq_is_initialized == 0)
{
@@
-1073,7
+1075,7
@@
chrony_read(void)
if (rc != CHRONY_RC_OK)
return rc;
if (rc != CHRONY_RC_OK)
return rc;
- for (now_src = 0; now_src < n_sources; ++now_src)
+ for (
unsigned int
now_src = 0; now_src < n_sources; ++now_src)
{
int is_reachable;
rc = chrony_request_source_data(now_src, &is_reachable);
{
int is_reachable;
rc = chrony_request_source_data(now_src, &is_reachable);