Code

curl plugin: Don't use CDTIME_T_TO_DOUBLE() within a composite literal.
authorFlorian Forster <octo@collectd.org>
Thu, 27 Oct 2016 19:19:35 +0000 (21:19 +0200)
committerFlorian Forster <octo@collectd.org>
Thu, 27 Oct 2016 19:19:35 +0000 (21:19 +0200)
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.

src/curl.c

index 1a5258e59552bfc34024e4fc1e8d34c72c533b3e..ced31e9330285f3a35122bd8006256179a6a703e 100644 (file)
@@ -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);