From: Ruben Kerkhof Date: Wed, 10 Aug 2016 14:03:20 +0000 (+0200) Subject: write_sensu plugin: fix build on OpenBSD X-Git-Tag: collectd-5.6.0~60 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6fbd510673ef3d9c3a589f9789195ccdf8fbdd2c;p=collectd.git write_sensu plugin: fix build on OpenBSD time_t is a long long on OpenBSD --- diff --git a/src/write_sensu.c b/src/write_sensu.c index 77069c08..6cb49943 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -532,7 +532,7 @@ static char *sensu_value_to_json(struct sensu_host const *host, /* {{{ */ in_place_replace_sensu_name_reserved(service_buffer); // finalize the buffer by setting the output and closing curly bracket - res = my_asprintf(&temp_str, "%s, \"output\": \"%s %s %ld\"}\n", ret_str, service_buffer, value_str, CDTIME_T_TO_TIME_T(vl->time)); + res = my_asprintf(&temp_str, "%s, \"output\": \"%s %s %lld\"}\n",ret_str, service_buffer, value_str, (long long)CDTIME_T_TO_TIME_T(vl->time)); free(ret_str); free(value_str); if (res == -1) { @@ -668,7 +668,7 @@ static char *sensu_notification_to_json(struct sensu_host *host, /* {{{ */ ret_str = temp_str; // incorporate the timestamp - res = my_asprintf(&temp_str, "%s, \"timestamp\": %ld", ret_str, CDTIME_T_TO_TIME_T(n->time)); + res = my_asprintf(&temp_str, "%s, \"timestamp\": %lld", ret_str, (long long)CDTIME_T_TO_TIME_T(n->time)); free(ret_str); if (res == -1) { ERROR("write_sensu plugin: Unable to alloc memory");