d91dc13ba2
- Fix python bindings rrdtool info implementation (#435468)
37 lines
1.2 KiB
Diff
37 lines
1.2 KiB
Diff
Index: rrdtool/bindings/python/rrd_extra.h
|
|
===================================================================
|
|
--- rrdtool/bindings/python/rrd_extra.h (revision 1306)
|
|
+++ rrdtool/bindings/python/rrd_extra.h (revision 1332)
|
|
@@ -54,5 +54,4 @@
|
|
int rrd_open(
|
|
char *file_name,
|
|
- FILE ** in_file,
|
|
rrd_t *rrd,
|
|
int rdwr);
|
|
Index: rrdtool/bindings/python/rrdtoolmodule.c
|
|
===================================================================
|
|
--- rrdtool/bindings/python/rrdtoolmodule.c (revision 1306)
|
|
+++ rrdtool/bindings/python/rrdtoolmodule.c (revision 1332)
|
|
@@ -412,5 +412,4 @@
|
|
PyObject *r, *t, *ds;
|
|
rrd_t rrd;
|
|
- FILE *in_file;
|
|
char *filename;
|
|
unsigned long i, j;
|
|
@@ -419,10 +418,9 @@
|
|
return NULL;
|
|
|
|
- if (rrd_open(filename, &in_file, &rrd, RRD_READONLY) == -1) {
|
|
- PyErr_SetString(ErrorObject, rrd_get_error());
|
|
- rrd_clear_error();
|
|
- return NULL;
|
|
- }
|
|
- fclose(in_file);
|
|
+ if (!rrd_open(filename, &rrd, RRD_READONLY) == -1) {
|
|
+ PyErr_SetString(ErrorObject, rrd_get_error());
|
|
+ rrd_clear_error();
|
|
+ return NULL;
|
|
+ }
|
|
|
|
#define DICTSET_STR(dict, name, value) \
|