From 544804d5e19cd8890c069273bd93801689e6f8e7 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 15 Dec 2010 06:18:07 +0100 Subject: python wrappers: add dump_dir wrapper Signed-off-by: Denys Vlasenko --- src/report-python/dump_dir.c | 170 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 src/report-python/dump_dir.c (limited to 'src/report-python/dump_dir.c') diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c new file mode 100644 index 00000000..71daa088 --- /dev/null +++ b/src/report-python/dump_dir.c @@ -0,0 +1,170 @@ +/* + On-disk storage of crash dumps + + Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) + Copyright (C) 2009 RedHat inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#include +#include + +#include +#include "crash_dump.h" +#include "dump_dir.h" +#include "common.h" + +typedef struct { + PyObject_HEAD + struct dump_dir *dd; +} p_dump_dir; + +static void +p_dump_dir_dealloc(PyObject *pself) +{ + p_dump_dir *self = (p_dump_dir*)pself; + dd_close(self->dd); + self->dd = NULL; + self->ob_type->tp_free(pself); +} + +static PyObject * +p_dump_dir_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + p_dump_dir *self = (p_dump_dir *)type->tp_alloc(type, 0); + if (self) + self->dd = NULL; + return (PyObject *)self; +} + +//static int +//p_dump_dir_init(PyObject *pself, PyObject *args, PyObject *kwds) +//{ +// return 0; +//} + + +/* void dd_close(struct dump_dir *dd); */ +static PyObject *p_dd_close(PyObject *pself, PyObject *args) +{ + p_dump_dir *self = (p_dump_dir*)pself; + dd_close(self->dd); + self->dd = NULL; + Py_RETURN_NONE; +} + +/* void dd_delete(struct dump_dir *dd); */ +static PyObject *p_dd_delete(PyObject *pself, PyObject *args) +{ + p_dump_dir *self = (p_dump_dir*)pself; + dd_delete(self->dd); + self->dd = NULL; + Py_RETURN_NONE; +} + +/* int dd_exist(struct dump_dir *dd, const char *path); */ +static PyObject *p_dd_exist(PyObject *pself, PyObject *args) +{ + p_dump_dir *self = (p_dump_dir*)pself; + const char *path; + if (!PyArg_ParseTuple(args, "s", &path)) + { + return NULL; + } + return Py_BuildValue("i", dd_exist(self->dd, path)); +} + +/* DIR *dd_init_next_file(struct dump_dir *dd); */ +//static PyObject *p_dd_init_next_file(PyObject *pself, PyObject *args); +/* int dd_get_next_file(struct dump_dir *dd, char **short_name, char **full_name); */ +//static PyObject *p_dd_get_next_file(PyObject *pself, PyObject *args); + +/* char* dd_load_text_ext(const struct dump_dir *dd, const char *name, unsigned flags); */ +/* char* dd_load_text(const struct dump_dir *dd, const char *name); */ +static PyObject *p_dd_load_text_ext(PyObject *pself, PyObject *args) +{ + p_dump_dir *self = (p_dump_dir*)pself; + const char *name; + int flags = 0; + if (!PyArg_ParseTuple(args, "s|i", &name, &flags)) + { + return NULL; + } + char *val = dd_load_text_ext(self->dd, name, flags); + PyObject *obj = Py_BuildValue("s", val); /* NB: if val is NULL, obj is None */ + free(val); + return obj; +} + +/* void dd_save_text(struct dump_dir *dd, const char *name, const char *data); */ +static PyObject *p_dd_save_text(PyObject *pself, PyObject *args) +{ + p_dump_dir *self = (p_dump_dir*)pself; + const char *name; + const char *data; + if (!PyArg_ParseTuple(args, "ss", &name, &data)) + { + return NULL; + } + dd_save_text(self->dd, name, data); + Py_RETURN_NONE; +} + +/* void dd_save_binary(struct dump_dir *dd, const char *name, const char *data, unsigned size); */ +static PyObject *p_dd_save_binary(PyObject *pself, PyObject *args) +{ + p_dump_dir *self = (p_dump_dir*)pself; + const char *name; + const char *data; + unsigned size; + if (!PyArg_ParseTuple(args, "ssI", &name, &data, &size)) + { + return NULL; + } + dd_save_binary(self->dd, name, data, size); + Py_RETURN_NONE; +} + +static PyMethodDef p_dump_dir_methods[] = { + { "close" , p_dd_close, METH_NOARGS, NULL }, + { "delete" , p_dd_delete, METH_NOARGS, NULL }, + { "exist" , p_dd_exist, METH_VARARGS, NULL }, + { "load_text" , p_dd_load_text_ext, METH_VARARGS, NULL }, + { "save_text" , p_dd_save_text, METH_VARARGS, NULL }, + { "save_binary", p_dd_save_binary, METH_VARARGS, NULL }, + { NULL } +}; + +PyTypeObject p_dump_dir_type = { + PyObject_HEAD_INIT(NULL) + .tp_name = "report.dump_dir", + .tp_basicsize = sizeof(p_dump_dir), + .tp_dealloc = p_dump_dir_dealloc, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + .tp_doc = "dump_dir objects", + .tp_methods = p_dump_dir_methods, + //.tp_members = p_dump_dir_members, + //.tp_init = p_dump_dir_init, + .tp_new = p_dump_dir_new, +}; + + +/* struct dump_dir *dd_opendir(const char *dir, int flags); */ +//static PyObject *p_dd_opendir(PyObject *pself, PyObject *args); +/* struct dump_dir *dd_create(const char *dir, uid_t uid); */ +//static PyObject *p_dd_create(PyObject *pself, PyObject *args); + +/* void delete_crash_dump_dir(const char *dd_dir); */ +//static PyObject *p_delete_crash_dump_dir(PyObject *pself, PyObject *args); -- cgit From 6da0fdade325c2ce0f371e661801e6beb1e70cdb Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 15 Dec 2010 18:33:43 +0100 Subject: python wrappers: make crash_data.create_crash_dump_dir() work Signed-off-by: Denys Vlasenko --- src/report-python/dump_dir.c | 47 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'src/report-python/dump_dir.c') diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c index 71daa088..8e1f17ef 100644 --- a/src/report-python/dump_dir.c +++ b/src/report-python/dump_dir.c @@ -26,11 +26,6 @@ #include "dump_dir.h" #include "common.h" -typedef struct { - PyObject_HEAD - struct dump_dir *dd; -} p_dump_dir; - static void p_dump_dir_dealloc(PyObject *pself) { @@ -147,6 +142,16 @@ static PyMethodDef p_dump_dir_methods[] = { { NULL } }; +static int p_dd_is_non_null(PyObject *pself) +{ + p_dump_dir *self = (p_dump_dir*)pself; + return self->dd != NULL; +} + +static PyNumberMethods p_dump_dir_number_methods = { + .nb_nonzero = p_dd_is_non_null, +}; + PyTypeObject p_dump_dir_type = { PyObject_HEAD_INIT(NULL) .tp_name = "report.dump_dir", @@ -158,13 +163,41 @@ PyTypeObject p_dump_dir_type = { //.tp_members = p_dump_dir_members, //.tp_init = p_dump_dir_init, .tp_new = p_dump_dir_new, + .tp_as_number = &p_dump_dir_number_methods, }; /* struct dump_dir *dd_opendir(const char *dir, int flags); */ -//static PyObject *p_dd_opendir(PyObject *pself, PyObject *args); +PyObject *p_dd_opendir(PyObject *module, PyObject *args) +{ + const char *dir; + int flags = 0; + if (!PyArg_ParseTuple(args, "s|i", &dir, &flags)) + return NULL; +// PyObject *new_obj = PyObject_CallObject(&p_dump_dir_type, NULL); /* constructor call */ +// p_dump_dir *new_dd = (p_dump_dir*)new_obj; + p_dump_dir *new_dd = PyObject_New(p_dump_dir, &p_dump_dir_type); + if (!new_dd) + return NULL; + new_dd->dd = dd_opendir(dir, flags); + return (PyObject*)new_dd; +} + /* struct dump_dir *dd_create(const char *dir, uid_t uid); */ -//static PyObject *p_dd_create(PyObject *pself, PyObject *args); +PyObject *p_dd_create(PyObject *module, PyObject *args) +{ + const char *dir; + int uid; + if (!PyArg_ParseTuple(args, "si", &dir, &uid)) + return NULL; +// PyObject *new_obj = PyObject_CallObject(&p_dump_dir_type, NULL); /* constructor call */ +// p_dump_dir *new_dd = (p_dump_dir*)new_obj; + p_dump_dir *new_dd = PyObject_New(p_dump_dir, &p_dump_dir_type); + if (!new_dd) + return NULL; + new_dd->dd = dd_create(dir, uid); + return (PyObject*)new_dd; +} /* void delete_crash_dump_dir(const char *dd_dir); */ //static PyObject *p_delete_crash_dump_dir(PyObject *pself, PyObject *args); -- cgit From 6a2b728d7525214402eff838bb37be175ddce6c3 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 15 Dec 2010 18:44:55 +0100 Subject: Rename foo_crash_dump_dir -> foo_dump_dir To be exact, these three functions are renamed: load_crash_data_from_crash_dump_dir create_crash_dump_dir delete_crash_dump_dir Rationale: data structure is called "struct dump_dir", not "struct crash_dump_dir" Signed-off-by: Denys Vlasenko --- src/report-python/dump_dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/report-python/dump_dir.c') diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c index 8e1f17ef..df61ea74 100644 --- a/src/report-python/dump_dir.c +++ b/src/report-python/dump_dir.c @@ -199,5 +199,5 @@ PyObject *p_dd_create(PyObject *module, PyObject *args) return (PyObject*)new_dd; } -/* void delete_crash_dump_dir(const char *dd_dir); */ -//static PyObject *p_delete_crash_dump_dir(PyObject *pself, PyObject *args); +/* void delete_dump_dir(const char *dd_dir); */ +//static PyObject *p_delete_dump_dir(PyObject *pself, PyObject *args); -- cgit From 27276b34e3631f60a2414ab9c199f28de9b03780 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 16 Dec 2010 04:48:22 +0100 Subject: python wrapper: trivial cleanup Signed-off-by: Denys Vlasenko --- src/report-python/dump_dir.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/report-python/dump_dir.c') diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c index df61ea74..eb72e10b 100644 --- a/src/report-python/dump_dir.c +++ b/src/report-python/dump_dir.c @@ -22,7 +22,6 @@ #include #include -#include "crash_dump.h" #include "dump_dir.h" #include "common.h" @@ -174,8 +173,6 @@ PyObject *p_dd_opendir(PyObject *module, PyObject *args) int flags = 0; if (!PyArg_ParseTuple(args, "s|i", &dir, &flags)) return NULL; -// PyObject *new_obj = PyObject_CallObject(&p_dump_dir_type, NULL); /* constructor call */ -// p_dump_dir *new_dd = (p_dump_dir*)new_obj; p_dump_dir *new_dd = PyObject_New(p_dump_dir, &p_dump_dir_type); if (!new_dd) return NULL; @@ -190,8 +187,6 @@ PyObject *p_dd_create(PyObject *module, PyObject *args) int uid; if (!PyArg_ParseTuple(args, "si", &dir, &uid)) return NULL; -// PyObject *new_obj = PyObject_CallObject(&p_dump_dir_type, NULL); /* constructor call */ -// p_dump_dir *new_dd = (p_dump_dir*)new_obj; p_dump_dir *new_dd = PyObject_New(p_dump_dir, &p_dump_dir_type); if (!new_dd) return NULL; -- cgit From 75ead03a87172bc3a60ab5628a9c78e01f74ad03 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 16 Dec 2010 13:13:59 +0100 Subject: report-python/dump_dir: fix SEGV when dd.op() operates on closed dd Signed-off-by: Denys Vlasenko --- src/report-python/dump_dir.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/report-python/dump_dir.c') diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c index eb72e10b..b207757d 100644 --- a/src/report-python/dump_dir.c +++ b/src/report-python/dump_dir.c @@ -63,6 +63,12 @@ static PyObject *p_dd_close(PyObject *pself, PyObject *args) static PyObject *p_dd_delete(PyObject *pself, PyObject *args) { p_dump_dir *self = (p_dump_dir*)pself; +//Do we want to disallow delete() on non-opened dd? +// if (!self->dd) +// { +// PyErr_SetString(ReportError, "dump dir is not open"); +// return NULL; +// } dd_delete(self->dd); self->dd = NULL; Py_RETURN_NONE; @@ -72,6 +78,11 @@ static PyObject *p_dd_delete(PyObject *pself, PyObject *args) static PyObject *p_dd_exist(PyObject *pself, PyObject *args) { p_dump_dir *self = (p_dump_dir*)pself; + if (!self->dd) + { + PyErr_SetString(ReportError, "dump dir is not open"); + return NULL; + } const char *path; if (!PyArg_ParseTuple(args, "s", &path)) { @@ -90,6 +101,11 @@ static PyObject *p_dd_exist(PyObject *pself, PyObject *args) static PyObject *p_dd_load_text_ext(PyObject *pself, PyObject *args) { p_dump_dir *self = (p_dump_dir*)pself; + if (!self->dd) + { + PyErr_SetString(ReportError, "dump dir is not open"); + return NULL; + } const char *name; int flags = 0; if (!PyArg_ParseTuple(args, "s|i", &name, &flags)) @@ -106,6 +122,11 @@ static PyObject *p_dd_load_text_ext(PyObject *pself, PyObject *args) static PyObject *p_dd_save_text(PyObject *pself, PyObject *args) { p_dump_dir *self = (p_dump_dir*)pself; + if (!self->dd) + { + PyErr_SetString(ReportError, "dump dir is not open"); + return NULL; + } const char *name; const char *data; if (!PyArg_ParseTuple(args, "ss", &name, &data)) @@ -120,6 +141,11 @@ static PyObject *p_dd_save_text(PyObject *pself, PyObject *args) static PyObject *p_dd_save_binary(PyObject *pself, PyObject *args) { p_dump_dir *self = (p_dump_dir*)pself; + if (!self->dd) + { + PyErr_SetString(ReportError, "dump dir is not open"); + return NULL; + } const char *name; const char *data; unsigned size; -- cgit From 628fb1fbae2a9e3e8fc3add070bceb5557973029 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 16 Dec 2010 18:28:07 +0100 Subject: create_dump_dir: add base_dir_name parameter. This makes python wrappers more usable. src/report-python/test_full demonstrates how pyhton programs can run reporting now. Signed-off-by: Denys Vlasenko --- src/report-python/dump_dir.c | 79 +++++++++++++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 19 deletions(-) (limited to 'src/report-python/dump_dir.c') diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c index b207757d..04a58d31 100644 --- a/src/report-python/dump_dir.c +++ b/src/report-python/dump_dir.c @@ -1,8 +1,8 @@ /* On-disk storage of crash dumps - Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) - Copyright (C) 2009 RedHat inc. + Copyright (C) 2010 Abrt team + Copyright (C) 2010 RedHat inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,14 +25,7 @@ #include "dump_dir.h" #include "common.h" -static void -p_dump_dir_dealloc(PyObject *pself) -{ - p_dump_dir *self = (p_dump_dir*)pself; - dd_close(self->dd); - self->dd = NULL; - self->ob_type->tp_free(pself); -} +/*** init/cleanup ***/ static PyObject * p_dump_dir_new(PyTypeObject *type, PyObject *args, PyObject *kwds) @@ -43,6 +36,15 @@ p_dump_dir_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return (PyObject *)self; } +static void +p_dump_dir_dealloc(PyObject *pself) +{ + p_dump_dir *self = (p_dump_dir*)pself; + dd_close(self->dd); + self->dd = NULL; + self->ob_type->tp_free(pself); +} + //static int //p_dump_dir_init(PyObject *pself, PyObject *args, PyObject *kwds) //{ @@ -50,6 +52,8 @@ p_dump_dir_new(PyTypeObject *type, PyObject *args, PyObject *kwds) //} +/*** methods ***/ + /* void dd_close(struct dump_dir *dd); */ static PyObject *p_dd_close(PyObject *pself, PyObject *args) { @@ -98,7 +102,7 @@ static PyObject *p_dd_exist(PyObject *pself, PyObject *args) /* char* dd_load_text_ext(const struct dump_dir *dd, const char *name, unsigned flags); */ /* char* dd_load_text(const struct dump_dir *dd, const char *name); */ -static PyObject *p_dd_load_text_ext(PyObject *pself, PyObject *args) +static PyObject *p_dd_load_text(PyObject *pself, PyObject *args) { p_dump_dir *self = (p_dump_dir*)pself; if (!self->dd) @@ -157,22 +161,49 @@ static PyObject *p_dd_save_binary(PyObject *pself, PyObject *args) Py_RETURN_NONE; } + +/*** attribute getters/setters ***/ + +static PyObject *get_name(PyObject *pself, void *unused) +{ + p_dump_dir *self = (p_dump_dir*)pself; + if (self->dd) + return Py_BuildValue("s", self->dd->dd_dir); + Py_RETURN_NONE; +} + +//static PyObject *set_name(PyObject *pself, void *unused) +//{ +// PyErr_SetString(ReportError, "dump dir name is not settable"); +// Py_RETURN_NONE; +//} + + +/*** type object ***/ + static PyMethodDef p_dump_dir_methods[] = { + /* method_name, func, flags, doc_string */ { "close" , p_dd_close, METH_NOARGS, NULL }, { "delete" , p_dd_delete, METH_NOARGS, NULL }, { "exist" , p_dd_exist, METH_VARARGS, NULL }, - { "load_text" , p_dd_load_text_ext, METH_VARARGS, NULL }, + { "load_text" , p_dd_load_text, METH_VARARGS, NULL }, { "save_text" , p_dd_save_text, METH_VARARGS, NULL }, { "save_binary", p_dd_save_binary, METH_VARARGS, NULL }, { NULL } }; +static PyGetSetDef p_dump_dir_getset[] = { + /* attr_name, getter_func, setter_func, doc_string, void_param */ + { "name", get_name, NULL /*set_name*/ }, + { NULL } +}; + +/* Support for "dd = dd_opendir(...); if [not] dd: ..." */ static int p_dd_is_non_null(PyObject *pself) { p_dump_dir *self = (p_dump_dir*)pself; return self->dd != NULL; } - static PyNumberMethods p_dump_dir_number_methods = { .nb_nonzero = p_dd_is_non_null, }; @@ -181,17 +212,20 @@ PyTypeObject p_dump_dir_type = { PyObject_HEAD_INIT(NULL) .tp_name = "report.dump_dir", .tp_basicsize = sizeof(p_dump_dir), - .tp_dealloc = p_dump_dir_dealloc, + /* Py_TPFLAGS_BASETYPE means "can be subtyped": */ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, - .tp_doc = "dump_dir objects", - .tp_methods = p_dump_dir_methods, - //.tp_members = p_dump_dir_members, - //.tp_init = p_dump_dir_init, .tp_new = p_dump_dir_new, + .tp_dealloc = p_dump_dir_dealloc, + //.tp_init = p_dump_dir_init, + //.tp_members = p_dump_dir_members, + .tp_methods = p_dump_dir_methods, .tp_as_number = &p_dump_dir_number_methods, + .tp_getset = p_dump_dir_getset, }; +/*** module-level functions ***/ + /* struct dump_dir *dd_opendir(const char *dir, int flags); */ PyObject *p_dd_opendir(PyObject *module, PyObject *args) { @@ -221,4 +255,11 @@ PyObject *p_dd_create(PyObject *module, PyObject *args) } /* void delete_dump_dir(const char *dd_dir); */ -//static PyObject *p_delete_dump_dir(PyObject *pself, PyObject *args); +PyObject *p_delete_dump_dir(PyObject *pself, PyObject *args) +{ + const char *dir; + if (!PyArg_ParseTuple(args, "s", &dir)) + return NULL; + delete_dump_dir(dir); + Py_RETURN_NONE; +} -- cgit From dba326f60e159697a740f08959d098e19c200453 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 22 Dec 2010 16:28:39 +0100 Subject: extend run_event() to run_event_on_dir_name() and run_event_on_crash_data() Signed-off-by: Denys Vlasenko --- src/report-python/dump_dir.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/report-python/dump_dir.c') diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c index 04a58d31..249a9478 100644 --- a/src/report-python/dump_dir.c +++ b/src/report-python/dump_dir.c @@ -22,7 +22,6 @@ #include #include -#include "dump_dir.h" #include "common.h" /*** init/cleanup ***/ -- cgit From 3b1a9d1f8db031563903a493be755419d7ba6620 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 4 Jan 2011 16:23:21 +0100 Subject: dump_dir: make chown'ing of new files optional - needed for non-root usage Signed-off-by: Denys Vlasenko --- src/report-python/dump_dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/report-python/dump_dir.c') diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c index 249a9478..067b905b 100644 --- a/src/report-python/dump_dir.c +++ b/src/report-python/dump_dir.c @@ -243,8 +243,8 @@ PyObject *p_dd_opendir(PyObject *module, PyObject *args) PyObject *p_dd_create(PyObject *module, PyObject *args) { const char *dir; - int uid; - if (!PyArg_ParseTuple(args, "si", &dir, &uid)) + int uid = -1; + if (!PyArg_ParseTuple(args, "s|i", &dir, &uid)) return NULL; p_dump_dir *new_dd = PyObject_New(p_dump_dir, &p_dump_dir_type); if (!new_dd) -- cgit From 3a6d12fcd182c0de13800fe463482d6a4408f885 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 28 Feb 2011 17:23:50 +0100 Subject: dump_dir API: rename dd_dir field to dd_dirname Signed-off-by: Denys Vlasenko --- src/report-python/dump_dir.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/report-python/dump_dir.c') diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c index 067b905b..c8ff3798 100644 --- a/src/report-python/dump_dir.c +++ b/src/report-python/dump_dir.c @@ -167,7 +167,7 @@ static PyObject *get_name(PyObject *pself, void *unused) { p_dump_dir *self = (p_dump_dir*)pself; if (self->dd) - return Py_BuildValue("s", self->dd->dd_dir); + return Py_BuildValue("s", self->dd->dd_dirname); Py_RETURN_NONE; } @@ -253,12 +253,12 @@ PyObject *p_dd_create(PyObject *module, PyObject *args) return (PyObject*)new_dd; } -/* void delete_dump_dir(const char *dd_dir); */ +/* void delete_dump_dir(const char *dirname); */ PyObject *p_delete_dump_dir(PyObject *pself, PyObject *args) { - const char *dir; - if (!PyArg_ParseTuple(args, "s", &dir)) + const char *dirname; + if (!PyArg_ParseTuple(args, "s", &dirname)) return NULL; - delete_dump_dir(dir); + delete_dump_dir(dirname); Py_RETURN_NONE; } -- cgit