From: Florian Forster Date: Mon, 19 Jan 2009 12:05:23 +0000 (+0100) Subject: bind plugin: Don't use LLONG_{MIN,MAX} to increase portability. X-Git-Tag: collectd-4.6.0~98^2 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=d479f22cf71c80e7c8717a0f6a28dab6ea1d277b bind plugin: Don't use LLONG_{MIN,MAX} to increase portability. Sagly, there's a bug in some versions of GCC/GNU libc which leads to LLONG_* not being defined. We'll check the return value of strtoll for `>0' and `<0', which should do the trick, too. --- diff --git a/src/bind.c b/src/bind.c index 1a06a4d5..e09da192 100644 --- a/src/bind.c +++ b/src/bind.c @@ -380,9 +380,9 @@ static int bind_xml_read_counter (xmlDoc *doc, xmlNode *node, xmlFree(str_ptr); if (str_ptr == end_ptr || errno) { - if (errno && value == LLONG_MIN) + if (errno && (value < 0)) ERROR ("bind plugin: bind_xml_read_counter: strtoll failed with underflow."); - else if (errno && value == LLONG_MAX) + else if (errno && (value > 0)) ERROR ("bind plugin: bind_xml_read_counter: strtoll failed with overflow."); else ERROR ("bind plugin: bind_xml_read_counter: strtoll failed.");