From 8926620824c302c358d7a71e41d29a9b6e8474b2 Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 27 Oct 2009 17:04:03 +0000 Subject: [PATCH] more solaris 10 portability changes .... git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1954 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_client.c | 2 ++ src/rrd_graph.h | 5 +++++ src/rrd_restore.c | 15 ++++++++++----- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/rrd_client.c b/src/rrd_client.c index b018ee0..034beca 100644 --- a/src/rrd_client.c +++ b/src/rrd_client.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -33,6 +34,7 @@ #include #include #include +#include #ifndef ENODATA #define ENODATA ENOENT diff --git a/src/rrd_graph.h b/src/rrd_graph.h index d3de4cf..c11ac2f 100644 --- a/src/rrd_graph.h +++ b/src/rrd_graph.h @@ -9,6 +9,11 @@ #include #include #include + +/* without this will not compile on solaris */ +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ +#endif #include diff --git a/src/rrd_restore.c b/src/rrd_restore.c index d75247d..d351cba 100644 --- a/src/rrd_restore.c +++ b/src/rrd_restore.c @@ -275,21 +275,26 @@ static int get_xml_double( double *value) { - char *text; + xmlChar *text; double temp; if ((text = (char *)get_xml_text(reader))!= NULL){ - if (strcasestr(text,"nan")){ + char *c = text; + while (c){ + *c=tolower((unsigned char)(*c)); + c++; + } + if (xmlStrcasestr(text,(xmlChar *)"nan")){ *value = DNAN; xmlFree(text); return 0; } - else if (strcasestr(text,"-inf")){ + else if (xmlStrcasestr(text,(xmlChar *)"-inf")){ *value = -DINF; xmlFree(text); return 0; } - else if (strcasestr(text,"+inf") - || strcasestr(text,"inf")){ + else if (xmlStrcasestr(text,(xmlChar *)"+inf") + || xmlStrcasestr(text,(xmlChar *)"inf")){ *value = DINF; xmlFree(text); return 0; -- 2.11.0