summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a9f509b)
raw | patch | inline | side by side (parent: a9f509b)
author | Florian Forster <octo@collectd.org> | |
Wed, 26 Oct 2016 18:59:32 +0000 (20:59 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 26 Oct 2016 18:59:32 +0000 (20:59 +0200) |
diff --git a/src/daemon/common.c b/src/daemon/common.c
index 3d1420d62da20c5d5b8f1b02ed1f1acfa719f529..208e16dd753019232943a78dc9a22098409c2e2f 100644 (file)
--- a/src/daemon/common.c
+++ b/src/daemon/common.c
int status;
int socktype;
- socklen_t socklen = sizeof (socklen_t);
- int so_keepalive = 1;
-
- status = getsockopt (sockfd, SOL_SOCKET, SO_TYPE, &socktype, &socklen);
+ status = getsockopt (sockfd, SOL_SOCKET, SO_TYPE,
+ &socktype, &(socklen_t) { sizeof (socktype) });
if (status != 0)
{
WARNING ("set_sock_opts: failed to determine socket type");
if (socktype == SOCK_STREAM)
{
status = setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE,
- &so_keepalive, sizeof (so_keepalive));
+ &(int) {1}, sizeof (int));
if (status != 0)
WARNING ("set_sock_opts: failed to set socket keepalive flag");
diff --git a/src/log_logstash.c b/src/log_logstash.c
index 08868409d2b575edfd080f0cf81ffb8d1ada5740..24083a5081e1445d78d61002f3b111fdd0c14020 100644 (file)
--- a/src/log_logstash.c
+++ b/src/log_logstash.c
struct tm timestamp_tm;
char timestamp_str[64];
const unsigned char *buf;
- time_t tt;
#if HAVE_YAJL_V2
size_t len;
#else
yajl_gen_status_ok)
goto err;
- tt = CDTIME_T_TO_TIME_T (timestamp_time);
- gmtime_r (&tt, ×tamp_tm);
+ gmtime_r (&CDTIME_T_TO_TIME_T (timestamp_time), ×tamp_tm);
/*
* format time as a UTC ISO 8601 compliant string
diff --git a/src/logfile.c b/src/logfile.c
index d18a5365556a67f9cd0be54595d3cfa3d0883588..6d555842f787dda0c687c0a08d2cf4657cd6aba3 100644 (file)
--- a/src/logfile.c
+++ b/src/logfile.c
{
FILE *fh;
_Bool do_close = 0;
- struct tm timestamp_tm;
char timestamp_str[64];
char level_str[16] = "";
if (print_timestamp)
{
- time_t tt = CDTIME_T_TO_TIME_T (timestamp_time);
- localtime_r (&tt, ×tamp_tm);
+ struct tm timestamp_tm;
+ localtime_r (&CDTIME_T_TO_TIME_T (timestamp_time), ×tamp_tm);
strftime (timestamp_str, sizeof (timestamp_str), "%Y-%m-%d %H:%M:%S",
×tamp_tm);
diff --git a/src/notify_email.c b/src/notify_email.c
index cefeb22f4717d6b53695b123099ca570491d47f8..dc20cbbe04b37d90ddeb76bb60dd2886a99fd6d4 100644 (file)
--- a/src/notify_email.c
+++ b/src/notify_email.c
user_data_t __attribute__((unused)) *user_data)
{
- time_t tt;
struct tm timestamp_tm;
char timestamp_str[64];
(email_subject == NULL) ? DEFAULT_SMTP_SUBJECT : email_subject,
severity, n->host);
- tt = CDTIME_T_TO_TIME_T (n->time);
- localtime_r (&tt, ×tamp_tm);
+ localtime_r (&CDTIME_T_TO_TIME_T (n->time), ×tamp_tm);
strftime (timestamp_str, sizeof (timestamp_str), "%Y-%m-%d %H:%M:%S",
×tamp_tm);
timestamp_str[sizeof (timestamp_str) - 1] = '\0';
diff --git a/src/openldap.c b/src/openldap.c
index d5e58b1a67d0f9b2295097a7b5705188b517b6dd..e100aeed61bec89dd2e67a523827d64a230bfb75 100644 (file)
--- a/src/openldap.c
+++ b/src/openldap.c
}
st->starttls = 0;
- st->timeout = (long) (CDTIME_T_TO_MS(plugin_get_interval()) / 1000);
+ st->timeout = (long) CDTIME_T_TO_TIME_T(plugin_get_interval());
st->verifyhost = 1;
st->version = LDAP_VERSION3;