summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-08 17:05:15 +0200
committerVolker Lendecke <vl@samba.org>2010-08-08 18:09:37 +0200
commit2b13864569115a3f459a4ffffba36b1d33513c83 (patch)
tree21dd256b990f16754fe2cbcea9b029c86d4e51db
parent8b6d88854c55553fce59aa8956d025b16f513a25 (diff)
downloadsamba-2b13864569115a3f459a4ffffba36b1d33513c83.tar.gz
samba-2b13864569115a3f459a4ffffba36b1d33513c83.tar.bz2
samba-2b13864569115a3f459a4ffffba36b1d33513c83.zip
s3: Lift the server_messaging_context from traverse_fn_delete
-rw-r--r--source3/printing/printing.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 753d7e72c4..b3f0673e10 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -799,6 +799,8 @@ struct traverse_struct {
time_t lpq_time;
const char *lprm_command;
struct printif *print_if;
+ struct tevent_context *ev;
+ struct messaging_context *msg_ctx;
};
/****************************************************************************
@@ -832,8 +834,7 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
if (i == ts->qcount) {
DEBUG(10,("traverse_fn_delete: pjob %u deleted due to !smbjob\n",
(unsigned int)jobid ));
- pjob_delete(server_event_context(),
- server_messaging_context(),
+ pjob_delete(ts->ev, ts->msg_ctx,
ts->sharename, jobid);
return 0;
}
@@ -850,8 +851,7 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
if (!process_exists_by_pid(pjob.pid)) {
DEBUG(10,("traverse_fn_delete: pjob %u deleted due to !process_exists (%u)\n",
(unsigned int)jobid, (unsigned int)pjob.pid ));
- pjob_delete(server_event_context(),
- server_messaging_context(),
+ pjob_delete(ts->ev, ts->msg_ctx,
ts->sharename, jobid);
} else
ts->total_jobs++;
@@ -882,14 +882,13 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
if ( result != 0 ) {
/* if we can't delete, then reset the job status */
pjob.status = LPQ_QUEUED;
- pjob_store(server_event_context(),
- server_messaging_context(),
+ pjob_store(ts->ev, ts->msg_ctx,
ts->sharename, jobid, &pjob);
}
else {
/* if we deleted the job, the remove the tdb record */
- pjob_delete(server_event_context(),
- server_messaging_context(),
+ pjob_delete(ts->ev,
+ ts->msg_ctx,
ts->sharename, jobid);
pjob.status = LPQ_DELETED;
}
@@ -918,8 +917,7 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
(unsigned int)jobid,
(unsigned int)pjob.starttime,
(unsigned int)ts->lpq_time ));
- pjob_delete(server_event_context(),
- server_messaging_context(),
+ pjob_delete(ts->ev, ts->msg_ctx,
ts->sharename, jobid);
} else
ts->total_jobs++;
@@ -1322,6 +1320,8 @@ static void print_queue_update_internal( const char *sharename,
tstruct.sharename = sharename;
tstruct.lprm_command = lprm_command;
tstruct.print_if = current_printif;
+ tstruct.ev = server_event_context();
+ tstruct.msg_ctx = server_messaging_context();
tdb_traverse(pdb->tdb, traverse_fn_delete, (void *)&tstruct);