summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-08 17:00:55 +0200
committerVolker Lendecke <vl@samba.org>2010-08-08 18:09:37 +0200
commit0b423493c30ca291ed09c9c2fc288d59635e79df (patch)
tree1d14bbf0d6baf368e538c6d103aaf2f7c13bf462 /source3
parent6806ae729065ed0914d89b84eb486b0fe8bec89a (diff)
downloadsamba-0b423493c30ca291ed09c9c2fc288d59635e79df.tar.gz
samba-0b423493c30ca291ed09c9c2fc288d59635e79df.tar.bz2
samba-0b423493c30ca291ed09c9c2fc288d59635e79df.zip
s3: Lift the server_messaging_context from pjob_delete
Diffstat (limited to 'source3')
-rw-r--r--source3/include/printing.h1
-rw-r--r--source3/printing/printing.c34
2 files changed, 22 insertions, 13 deletions
diff --git a/source3/include/printing.h b/source3/include/printing.h
index 909ac6e230..3921b7c8fc 100644
--- a/source3/include/printing.h
+++ b/source3/include/printing.h
@@ -116,7 +116,6 @@ void print_spool_terminate(struct connection_struct *conn,
int unpack_pjob( uint8 *buf, int buflen, struct printjob *pjob );
uint32 sysjob_to_jobid(int unix_jobid);
-void pjob_delete(const char* sharename, uint32 jobid);
bool print_notify_register_pid(int snum);
bool print_notify_deregister_pid(int snum);
bool print_job_exists(const char* sharename, uint32 jobid);
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index febd2ba1c2..142d26fc46 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -712,7 +712,9 @@ done:
Remove a job structure from the database.
****************************************************************************/
-void pjob_delete(const char* sharename, uint32 jobid)
+static void pjob_delete(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char* sharename, uint32 jobid)
{
uint32_t tmp;
struct printjob *pjob;
@@ -738,9 +740,7 @@ void pjob_delete(const char* sharename, uint32 jobid)
properly. */
job_status = JOB_STATUS_DELETING|JOB_STATUS_DELETED;
- notify_job_status(server_event_context(),
- server_messaging_context(),
- sharename, jobid, job_status);
+ notify_job_status(ev, msg_ctx, sharename, jobid, job_status);
/* Remove from printing.tdb */
@@ -830,7 +830,9 @@ 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(ts->sharename, jobid);
+ pjob_delete(server_event_context(),
+ server_messaging_context(),
+ ts->sharename, jobid);
return 0;
}
@@ -846,7 +848,9 @@ 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(ts->sharename, jobid);
+ pjob_delete(server_event_context(),
+ server_messaging_context(),
+ ts->sharename, jobid);
} else
ts->total_jobs++;
return 0;
@@ -882,7 +886,9 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
}
else {
/* if we deleted the job, the remove the tdb record */
- pjob_delete(ts->sharename, jobid);
+ pjob_delete(server_event_context(),
+ server_messaging_context(),
+ ts->sharename, jobid);
pjob.status = LPQ_DELETED;
}
@@ -910,7 +916,9 @@ 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(ts->sharename, jobid);
+ pjob_delete(server_event_context(),
+ server_messaging_context(),
+ ts->sharename, jobid);
} else
ts->total_jobs++;
return 0;
@@ -2102,7 +2110,9 @@ static bool print_job_delete1(int snum, uint32 jobid)
if (!pdb)
return False;
- pjob_delete(sharename, jobid);
+ pjob_delete(server_event_context(),
+ server_messaging_context(),
+ sharename, jobid);
/* Ensure we keep a rough count of the number of total jobs... */
tdb_change_int32_atomic(pdb->tdb, "INFO/total_jobs", &njobs, -1);
release_print_db(pdb);
@@ -2742,7 +2752,7 @@ WERROR print_job_start(struct auth_serversupplied_info *server_info,
fail:
if (jobid != -1) {
- pjob_delete(sharename, jobid);
+ pjob_delete(server_event_context(), msg_ctx, sharename, jobid);
}
release_print_db(pdb);
@@ -2846,7 +2856,7 @@ NTSTATUS print_job_end(struct messaging_context *msg_ctx, int snum,
DEBUG(5,("print_job_end: canceling spool of %s (%s)\n",
pjob->filename, pjob->size ? "deleted" : "zero length" ));
unlink(pjob->filename);
- pjob_delete(sharename, jobid);
+ pjob_delete(server_event_context(), msg_ctx, sharename, jobid);
return NT_STATUS_OK;
}
@@ -2875,7 +2885,7 @@ fail:
/* Still need to add proper error return propagation! 010122:JRR */
pjob->fd = -1;
unlink(pjob->filename);
- pjob_delete(sharename, jobid);
+ pjob_delete(server_event_context(), msg_ctx, sharename, jobid);
return status;
}