diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-05-22 13:29:11 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2015-06-10 06:06:18 +0200 |
commit | 4399dc582fa06b04e1cec1d3aa59cd332e4b5ba2 (patch) | |
tree | 5926e29517c1a77dd607661313817cdb1db061f0 /lib | |
parent | f5838df58ea36e64cd0295b595df9cbd10d8c757 (diff) | |
download | samba-4399dc582fa06b04e1cec1d3aa59cd332e4b5ba2.tar.gz |
pytevent: Define missing TeventFd_Type object
The type objects for Fd was declared but never defined,
resulting in segfaults when it was used.
Define it.
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tevent/pytevent.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/tevent/pytevent.c b/lib/tevent/pytevent.c index 4de0e3de7e3..a495da5385d 100644 --- a/lib/tevent/pytevent.c +++ b/lib/tevent/pytevent.c @@ -415,6 +415,19 @@ static void py_fd_handler(struct tevent_context *ev, Py_XDECREF(ret); } +static void py_tevent_fp_dealloc(TeventFd_Object *self) +{ + talloc_free(self->fd); + PyObject_Del(self); +} + +static PyTypeObject TeventFd_Type = { + .tp_name = "tevent.Fd", + .tp_basicsize = sizeof(TeventFd_Object), + .tp_dealloc = (destructor)py_tevent_fp_dealloc, + .tp_flags = Py_TPFLAGS_DEFAULT, +}; + static PyObject *py_tevent_context_add_fd(TeventContext_Object *self, PyObject *args) { int fd, flags; |