X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_restore.c;h=4cbc37adc45ebc08de59ab2fb80822055d2c7cfd;hp=52c738ba5a1f36264cef2333fd12e42781dcfddd;hb=bed830e383db9d9fc563897442cc441981396504;hpb=78dc4685a152943c73fcd9cadb8f6d8ecc6d1d79 diff --git a/src/rrd_restore.c b/src/rrd_restore.c index 52c738b..4cbc37a 100644 --- a/src/rrd_restore.c +++ b/src/rrd_restore.c @@ -241,6 +241,7 @@ static int get_xml_ulong( return -1; } /* get_xml_ulong */ +#ifndef TIME_T_IS_LONG static int get_xml_llong( xmlTextReaderPtr reader, long long *value) @@ -265,6 +266,8 @@ static int get_xml_llong( return -1; } /* get_xml_llong */ +#endif + static int get_xml_double( xmlTextReaderPtr reader, double *value) @@ -1011,6 +1014,12 @@ static int parse_tag_rrd( status = get_xml_ulong(reader, &rrd->stat_head->pdp_step); else if (xmlStrcasecmp(element, (const xmlChar *) "lastupdate") == 0) { +#ifdef TIME_T_IS_LONG + status = get_xml_long(reader, &rrd->live_head->last_up); +#else +#ifdef TIME_T_IS_LONG_LONG + status = get_xml_llong(reader, &rrd->live_head->last_up); +#else if (sizeof(time_t) == sizeof(long)) { status = get_xml_long(reader, (long *)&rrd->live_head->last_up); @@ -1019,6 +1028,8 @@ static int parse_tag_rrd( status = get_xml_llong(reader, (long long *)&rrd->live_head->last_up); } +#endif +#endif } else if (xmlStrcasecmp(element, (const xmlChar *) "ds") == 0){ xmlFree(element);