summaryrefslogtreecommitdiffstats
path: root/source/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
commitcd961e50a3029898868d21263ccacb7d5f1f07b9 (patch)
treeb47fc8933aa95a41c564255bd52d1d8b57283531 /source/python/py_spoolss_jobs.c
parent2720c82a950a0afded25c2c161cda47ea412fea3 (diff)
downloadsamba-cd961e50a3029898868d21263ccacb7d5f1f07b9.tar.gz
samba-cd961e50a3029898868d21263ccacb7d5f1f07b9.tar.xz
samba-cd961e50a3029898868d21263ccacb7d5f1f07b9.zip
r8654: merging cli_spoolss_XX() updates from trunk
Diffstat (limited to 'source/python/py_spoolss_jobs.c')
-rw-r--r--source/python/py_spoolss_jobs.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/source/python/py_spoolss_jobs.c b/source/python/py_spoolss_jobs.c
index 59754bd36dd..8ea0ebc073a 100644
--- a/source/python/py_spoolss_jobs.c
+++ b/source/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;