summaryrefslogtreecommitdiff
path: root/source3/python/py_spoolss_jobs.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-07-20 15:35:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:00:14 -0500
commitecafd3754f35a2109a3a1eecbbdd72ade06b8502 (patch)
treed442ae80d7f93acd21ae2a4d35fcfc3c0f80f3e6 /source3/python/py_spoolss_jobs.c
parentb0f1c8df1641bf0e1c53750f4cc126d7b1e21159 (diff)
downloadsamba-ecafd3754f35a2109a3a1eecbbdd72ade06b8502.tar.gz
samba-ecafd3754f35a2109a3a1eecbbdd72ade06b8502.tar.bz2
samba-ecafd3754f35a2109a3a1eecbbdd72ade06b8502.zip
r8654: merging cli_spoolss_XX() updates from trunk
(This used to be commit cd961e50a3029898868d21263ccacb7d5f1f07b9)
Diffstat (limited to 'source3/python/py_spoolss_jobs.c')
-rw-r--r--source3/python/py_spoolss_jobs.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/source3/python/py_spoolss_jobs.c b/source3/python/py_spoolss_jobs.c
index 59754bd36d..8ea0ebc073 100644
--- a/source3/python/py_spoolss_jobs.c
+++ b/source3/python/py_spoolss_jobs.c
@@ -28,7 +28,7 @@ PyObject *spoolss_hnd_enumjobs(PyObject *self, PyObject *args, PyObject *kw)
WERROR werror;
PyObject *result;
int level = 1;
- uint32 i, needed, num_jobs;
+ uint32 i, num_jobs;
static char *kwlist[] = {"level", NULL};
JOB_INFO_CTR ctr;
@@ -40,14 +40,9 @@ PyObject *spoolss_hnd_enumjobs(PyObject *self, PyObject *args, PyObject *kw)
/* Call rpc function */
werror = cli_spoolss_enumjobs(
- hnd->cli, hnd->mem_ctx, 0, &needed, &hnd->pol, level, 0,
+ hnd->cli, hnd->mem_ctx, &hnd->pol, level, 0,
1000, &num_jobs, &ctr);
- if (W_ERROR_V(werror) == ERRinsufficientbuffer)
- werror = cli_spoolss_enumjobs(
- hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol,
- level, 0, 1000, &num_jobs, &ctr);
-
/* Return value */
result = Py_None;
@@ -123,7 +118,7 @@ PyObject *spoolss_hnd_getjob(PyObject *self, PyObject *args, PyObject *kw)
spoolss_policy_hnd_object *hnd = (spoolss_policy_hnd_object *)self;
WERROR werror;
PyObject *result;
- uint32 level = 1, jobid, needed;
+ uint32 level = 1, jobid;
static char *kwlist[] = {"jobid", "level", NULL};
JOB_INFO_CTR ctr;
@@ -135,14 +130,9 @@ PyObject *spoolss_hnd_getjob(PyObject *self, PyObject *args, PyObject *kw)
/* Call rpc function */
- werror = cli_spoolss_getjob(hnd->cli, hnd->mem_ctx, 0, &needed,
+ werror = cli_spoolss_getjob(hnd->cli, hnd->mem_ctx,
&hnd->pol, jobid, level, &ctr);
- if (W_ERROR_V(werror) == ERRinsufficientbuffer)
- werror = cli_spoolss_getjob(
- hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol,
- jobid, level, &ctr);
-
if (!W_ERROR_IS_OK(werror)) {
PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
return NULL;