summaryrefslogtreecommitdiffstats
path: root/health/health.c
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2022-01-11 13:12:09 +0200
committerGitHub <noreply@github.com>2022-01-11 13:12:09 +0200
commit4919103c4b715a83ebcc677431dab6ecbacabc9c (patch)
treebfbf35b20b5679358ffc09fedfd3a9e5d2504c3b /health/health.c
parent237c117da6f250ab37af849e7a430ccad3238097 (diff)
Fix time_t format (#11897)
Diffstat (limited to 'health/health.c')
-rw-r--r--health/health.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/health/health.c b/health/health.c
index d8e1d4b77e..820af93f38 100644
--- a/health/health.c
+++ b/health/health.c
@@ -101,7 +101,11 @@ static void health_silencers_init(void) {
freez(str);
}
} else {
- error("Health silencers file %s has the size %ld that is out of range[ 1 , %d ]. Aborting read.", silencers_filename, length, HEALTH_SILENCERS_MAX_FILE_LEN);
+ error(
+ "Health silencers file %s has the size %" PRId64 " that is out of range[ 1 , %d ]. Aborting read.",
+ silencers_filename,
+ (int64_t)length,
+ HEALTH_SILENCERS_MAX_FILE_LEN);
}
fclose(fd);
} else {
@@ -326,7 +330,7 @@ static inline void health_alarm_execute(RRDHOST *host, ALARM_ENTRY *ae) {
buffer_strcat(warn_alarms, ",");
buffer_strcat(warn_alarms, rc->name);
buffer_strcat(warn_alarms, "=");
- buffer_snprintf(warn_alarms, 11, "%ld", rc->last_status_change);
+ buffer_snprintf(warn_alarms, 11, "%"PRId64"", (int64_t)rc->last_status_change);
n_warn++;
} else if (ae->alarm_id == rc->id)
expr = rc->warning;
@@ -336,7 +340,7 @@ static inline void health_alarm_execute(RRDHOST *host, ALARM_ENTRY *ae) {
buffer_strcat(crit_alarms, ",");
buffer_strcat(crit_alarms, rc->name);
buffer_strcat(crit_alarms, "=");
- buffer_snprintf(crit_alarms, 11, "%ld", rc->last_status_change);
+ buffer_snprintf(crit_alarms, 11, "%"PRId64"", (int64_t)rc->last_status_change);
n_crit++;
} else if (ae->alarm_id == rc->id)
expr = rc->critical;
@@ -684,9 +688,10 @@ void *health_main(void *ptr) {
if (unlikely(check_if_resumed_from_suspension())) {
apply_hibernation_delay = 1;
- info("Postponing alarm checks for %ld seconds, because it seems that the system was just resumed from suspension.",
- hibernation_delay
- );
+ info(
+ "Postponing alarm checks for %"PRId64" seconds, "
+ "because it seems that the system was just resumed from suspension.",
+ (int64_t)hibernation_delay);
}
if (unlikely(silencers->all_alarms && silencers->stype == STYPE_DISABLE_ALARMS)) {
@@ -706,9 +711,10 @@ void *health_main(void *ptr) {
continue;
if (unlikely(apply_hibernation_delay)) {
-
- info("Postponing health checks for %ld seconds, on host '%s'.", hibernation_delay, host->hostname
- );
+ info(
+ "Postponing health checks for %"PRId64" seconds, on host '%s'.",
+ (int64_t)hibernation_delay,
+ host->hostname);
host->health_delay_up_to = now + hibernation_delay;
}