From df0c97fa374d8d4efab45c83638f14a2eeb72a50 Mon Sep 17 00:00:00 2001 From: spz Date: Sat, 13 Mar 2010 16:41:21 +0000 Subject: make "rrdtool restore" work on archs where time_t is an int --- databases/rrdtool/Makefile | 3 ++- databases/rrdtool/distinfo | 3 ++- databases/rrdtool/patches/patch-az | 29 +++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 databases/rrdtool/patches/patch-az (limited to 'databases/rrdtool') diff --git a/databases/rrdtool/Makefile b/databases/rrdtool/Makefile index 801f71122fe..3f3e6a55ce2 100644 --- a/databases/rrdtool/Makefile +++ b/databases/rrdtool/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.80 2010/03/05 08:00:35 martti Exp $ +# $NetBSD: Makefile,v 1.81 2010/03/13 16:41:21 spz Exp $ DISTNAME= rrdtool-1.3.9 +PKGREVISION= 1 CATEGORIES= databases graphics net MASTER_SITES= http://oss.oetiker.ch/rrdtool/pub/ diff --git a/databases/rrdtool/distinfo b/databases/rrdtool/distinfo index 24536597e34..3f5f3247b75 100644 --- a/databases/rrdtool/distinfo +++ b/databases/rrdtool/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.39 2009/10/29 12:43:49 martti Exp $ +$NetBSD: distinfo,v 1.40 2010/03/13 16:41:21 spz Exp $ SHA1 (rrdtool-1.3.9.tar.gz) = 5c202810bdf5e5dda3f06079c7739993622c7e86 RMD160 (rrdtool-1.3.9.tar.gz) = 2b05c37a713cca3d15d92d1d9c5292c3cc4e0781 Size (rrdtool-1.3.9.tar.gz) = 1189442 bytes SHA1 (patch-al) = 5ff520a236abe66ee7daf8ac56274da52dd42172 +SHA1 (patch-az) = e6d55613b6041546223e89763633e7fa81bc029f 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) -- cgit v1.2.3