From: Florian Forster Date: Thu, 27 Oct 2016 19:19:35 +0000 (+0200) Subject: curl plugin: Don't use CDTIME_T_TO_DOUBLE() within a composite literal. X-Git-Tag: collectd-5.7.0~45^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=661bf777b32b7df979586ac1e31eb22217d00049;p=collectd.git curl plugin: Don't use CDTIME_T_TO_DOUBLE() within a composite literal. GCC 4.6 has a problem with the original code: curl.c: In function 'cc_submit_response_time': curl.c:644:26: internal compiler error: Segmentation fault This is essentially a shot in the dark, trying to fix this issue. --- diff --git a/src/curl.c b/src/curl.c index 1a5258e5..ced31e93 100644 --- a/src/curl.c +++ b/src/curl.c @@ -637,11 +637,11 @@ static void cc_submit_response_code (const web_page_t *wp, long code) /* {{{ */ } /* }}} void cc_submit_response_code */ static void cc_submit_response_time (const web_page_t *wp, /* {{{ */ - cdtime_t response_time) + gauge_t response_time) { value_list_t vl = VALUE_LIST_INIT; - vl.values = &(value_t) { .gauge = CDTIME_T_TO_DOUBLE (response_time) }; + vl.values = &(value_t) { .gauge = response_time }; vl.values_len = 1; sstrncpy (vl.plugin, "curl", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance)); @@ -668,7 +668,7 @@ static int cc_read_page (web_page_t *wp) /* {{{ */ } if (wp->response_time) - cc_submit_response_time (wp, cdtime() - start); + cc_submit_response_time (wp, CDTIME_T_TO_DOUBLE (cdtime() - start)); if (wp->stats != NULL) curl_stats_dispatch (wp->stats, wp->curl, hostname_g, "curl", wp->instance);