mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +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:
parent
947520521e
commit
e0fdeda86c
@ -321,6 +321,25 @@ static int py_tevent_req_wait(struct tevent_context *ev,
|
||||
|
||||
#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,
|
||||
PyObject *kwds)
|
||||
{
|
||||
@ -400,25 +419,6 @@ static void py_cli_state_dealloc(struct py_cli_state *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,
|
||||
PyObject *kwds)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user