summaryrefslogtreecommitdiffstats
path: root/rrd-svn.patch
diff options
context:
space:
mode:
Diffstat (limited to 'rrd-svn.patch')
-rw-r--r--rrd-svn.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/rrd-svn.patch b/rrd-svn.patch
new file mode 100644
index 0000000..8e95bcf
--- /dev/null
+++ b/rrd-svn.patch
@@ -0,0 +1,86 @@
+Index: config.m4
+===================================================================
+--- config.m4 (révision 332618)
++++ config.m4 (copie de travail)
+@@ -67,6 +67,9 @@
+ dnl rrd_lastupdate_r available in 1.4.0+
+ PHP_CHECK_FUNC(rrd_lastupdate_r, rrd)
+
++ dnl rrd_disconnect available in 1.4.0+
++ PHP_CHECK_FUNC(rrdc_disconnect, rrd)
++
+ LDFLAGS=$old_LDFLAGS
+
+ PHP_NEW_EXTENSION(rrd, rrd.c rrd_graph.c rrd_create.c rrd_update.c rrd_info.c, $ext_shared)
+Index: rrd.c
+===================================================================
+--- rrd.c (révision 332618)
++++ rrd.c (copie de travail)
+@@ -481,6 +481,7 @@
+ }
+ /* }}} */
+
++#ifdef HAVE_RRDC_DISCONNECT
+ /* {{{ proto void rrdc_disconnect()
+ * Close any outstanding connection to rrd cache daemon.
+ */
+@@ -492,6 +493,7 @@
+
+ rrdc_disconnect();
+ }
++#endif
+
+ /* {{{ proto string rrd_version()
+ * Gets version of underlying librrd.
+@@ -573,7 +575,9 @@
+ PHP_FE(rrd_restore, arginfo_rrd_restore)
+ PHP_FE(rrd_tune, arginfo_rrd_tune)
+ PHP_FE(rrd_xport, arginfo_rrd_xport)
++#ifdef HAVE_RRDC_DISCONNECT
+ PHP_FE(rrdc_disconnect, NULL)
++#endif
+ PHP_FE(rrd_version, NULL)
+ {NULL, NULL, NULL}
+ };
+@@ -609,7 +613,9 @@
+ static PHP_MSHUTDOWN_FUNCTION(rrd)
+ {
+ /* ensure that any connection to rrd cache deamon will be closed */
++#ifdef HAVE_RRDC_DISCONNECT
+ rrdc_disconnect();
++#endif
+ return SUCCESS;
+ }
+ /* }}} */
+Index: tests/rrd_012.phpt
+===================================================================
+--- tests/rrd_012.phpt (révision 332618)
++++ tests/rrd_012.phpt (copie de travail)
+@@ -11,6 +11,8 @@
+ --FILE--
+ <?php
+ include('data/definition.inc');
++putenv('LANG=C');
++setlocale(LC_ALL, 'C');
+ var_dump($info = rrd_info($data_updatedDb));
+ var_dump($info["filename"] == $data_updatedDb);
+ ?>
+Index: tests/rrd_022.phpt
+===================================================================
+--- tests/rrd_022.phpt (révision 332618)
++++ tests/rrd_022.phpt (copie de travail)
+@@ -1,7 +1,13 @@
+ --TEST--
+ rrdc_disconnect test
+ --SKIPIF--
+-<?php include('skipif.inc'); ?>
++<?php
++include('skipif.inc');
++if (!function_exists("rrdc_disconnect")) {
++ die("skip rrdc_disconnect only in rrdtool >= 1.4");
++}
++
++?>
+ --FILE--
+ <?php
+ var_dump(rrdc_disconnect());