1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

s3-pylibsmb: move py_tevent_req_wait_exc up in the file

this is needed to be able to use it in other functions and
spares the prototype

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
This commit is contained in:
Christian Ambach 2012-09-16 11:39:26 -07:00 committed by Volker Lendecke
parent 947520521e
commit e0fdeda86c

View File

@ -321,6 +321,25 @@ static int py_tevent_req_wait(struct tevent_context *ev,
#endif #endif
static bool py_tevent_req_wait_exc(struct tevent_context *ev,
struct tevent_req *req)
{
int ret;
if (req == NULL) {
PyErr_NoMemory();
return false;
}
ret = py_tevent_req_wait(ev, req);
if (ret != 0) {
TALLOC_FREE(req);
errno = ret;
PyErr_SetFromErrno(PyExc_RuntimeError);
return false;
}
return true;
}
static PyObject *py_cli_state_new(PyTypeObject *type, PyObject *args, static PyObject *py_cli_state_new(PyTypeObject *type, PyObject *args,
PyObject *kwds) PyObject *kwds)
{ {
@ -400,25 +419,6 @@ static void py_cli_state_dealloc(struct py_cli_state *self)
self->ob_type->tp_free((PyObject *)self); self->ob_type->tp_free((PyObject *)self);
} }
static bool py_tevent_req_wait_exc(struct tevent_context *ev,
struct tevent_req *req)
{
int ret;
if (req == NULL) {
PyErr_NoMemory();
return false;
}
ret = py_tevent_req_wait(ev, req);
if (ret != 0) {
TALLOC_FREE(req);
errno = ret;
PyErr_SetFromErrno(PyExc_RuntimeError);
return false;
}
return true;
}
static PyObject *py_cli_create(struct py_cli_state *self, PyObject *args, static PyObject *py_cli_create(struct py_cli_state *self, PyObject *args,
PyObject *kwds) PyObject *kwds)
{ {