diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-12-15 18:33:43 +0100 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-12-15 18:33:43 +0100 |
| commit | 6da0fdade325c2ce0f371e661801e6beb1e70cdb (patch) | |
| tree | 7e3d359498fcb1119f19fb34dbae923f19317083 /src/report-python/crash_dump.c | |
| parent | 544804d5e19cd8890c069273bd93801689e6f8e7 (diff) | |
| download | abrt-6da0fdade325c2ce0f371e661801e6beb1e70cdb.tar.gz abrt-6da0fdade325c2ce0f371e661801e6beb1e70cdb.tar.xz abrt-6da0fdade325c2ce0f371e661801e6beb1e70cdb.zip | |
python wrappers: make crash_data.create_crash_dump_dir() work
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/report-python/crash_dump.c')
| -rw-r--r-- | src/report-python/crash_dump.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/report-python/crash_dump.c b/src/report-python/crash_dump.c index c56db087..868e97ec 100644 --- a/src/report-python/crash_dump.c +++ b/src/report-python/crash_dump.c @@ -108,18 +108,22 @@ static PyObject *p_get_crash_data_item(PyObject *pself, PyObject *args) return Py_BuildValue("sI", ci->content, ci->flags); } +/* struct dump_dir *create_crash_dump_dir(crash_data_t *crash_data); */ static PyObject *p_create_crash_dump_dir(PyObject *pself, PyObject *args) { p_crash_data *self = (p_crash_data*)pself; + p_dump_dir *new_dd = PyObject_New(p_dump_dir, &p_dump_dir_type); + if (!new_dd) + return NULL; struct dump_dir *dd = create_crash_dump_dir(self->cd); - if (dd == NULL) + if (!dd) { + PyObject_Del((PyObject*)new_dd); PyErr_SetString(ReportError, "Can't create the dump dir"); return NULL; } - //FIXME: return a python representation of dump_dir, when we have it.. - dd_close(dd); - Py_RETURN_NONE; + new_dd->dd = dd; + return (PyObject*)new_dd; } //static PyMemberDef p_crash_data_members[] = { @@ -130,7 +134,7 @@ static PyMethodDef p_crash_data_methods[] = { { "add" , p_crash_data_add, METH_VARARGS, "Adds item to the crash data using default flags" }, { "add_ext" , p_crash_data_add_ext, METH_VARARGS, "Adds item to the crash data" }, { "get" , p_get_crash_data_item, METH_VARARGS, "Gets the value of item indexed by the key" }, - { "to_dump_dir", p_create_crash_dump_dir, METH_NOARGS, "Saves the crash_data to"LOCALSTATEDIR"/run/abrt/tmp-<pid>-<time>" }, + { "create_crash_dump_dir", p_create_crash_dump_dir, METH_NOARGS, "Saves the crash_data to"LOCALSTATEDIR"/run/abrt/tmp-<pid>-<time>" }, { NULL } }; |
