diff options
author | spz <spz> | 2010-03-13 16:41:21 +0000 |
---|---|---|
committer | spz <spz> | 2010-03-13 16:41:21 +0000 |
commit | 028e87ce9caccdf1f9efa72c05ad71ca7bec72c0 (patch) | |
tree | f43a4d70be125dcba586f0342455970c750f256d /databases/rrdtool/patches | |
parent | bd3e29320173d4ff303a7cb1200b9a814a955de6 (diff) | |
download | pkgsrc-028e87ce9caccdf1f9efa72c05ad71ca7bec72c0.tar.gz |
make "rrdtool restore" work on archs where time_t is an int
Diffstat (limited to 'databases/rrdtool/patches')
-rw-r--r-- | databases/rrdtool/patches/patch-az | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/databases/rrdtool/patches/patch-az b/databases/rrdtool/patches/patch-az new file mode 100644 index 00000000000..276f7268db0 --- /dev/null +++ b/databases/rrdtool/patches/patch-az @@ -0,0 +1,29 @@ +$NetBSD: patch-az,v 1.1 2010/03/13 16:41:21 spz Exp $ + +--- src/rrd_restore.c.orig 2009-10-24 10:46:42.000000000 +0000 ++++ src/rrd_restore.c +@@ -966,10 +966,20 @@ static int parse_tag_rrd( + else { if (sizeof(time_t) == sizeof(long long)) { + status = get_llong_from_node(doc, child, (long long *)&rrd->live_head->last_up); + } +- else { +- rrd_set_error("can't convert to time_t ...", child->name); +- status = -1; +- } ++ else if (sizeof(time_t) == sizeof(int)) { ++ long temp_last_up; ++ status = get_long_from_node(doc, child, &temp_last_up); ++ if (temp_last_up < INT_MAX) ++ rrd->live_head->last_up = temp_last_up; ++ else { ++ rrd_set_error("can't convert to time_t ...", child->name); ++ status = -1; ++ } ++ } ++ else { ++ rrd_set_error("can't convert to time_t ...", child->name); ++ status = -1; ++ } + } + } + else if (xmlStrcmp(child->name, (const xmlChar *) "ds") == 0) |