summaryrefslogtreecommitdiff
path: root/source3/printing/printing.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2010-06-10 11:48:39 -0400
committerSimo Sorce <idra@samba.org>2010-06-10 17:30:45 -0400
commit09627638224759c985f0636c5616b0357c91e450 (patch)
treec3e0f6849b468a879daf4bac954abe7066cb2716 /source3/printing/printing.c
parentcbda0369a831ed279cec7ff231ad7399af74db39 (diff)
downloadsamba-09627638224759c985f0636c5616b0357c91e450.tar.gz
samba-09627638224759c985f0636c5616b0357c91e450.tar.bz2
samba-09627638224759c985f0636c5616b0357c91e450.zip
s3:misc make use of server_[event/messaging]_context directly
Untangle these functions from smbd specific dependencies so they can be freely used in multiple servers.
Diffstat (limited to 'source3/printing/printing.c')
-rw-r--r--source3/printing/printing.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 05728d1731..74edb25eb5 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -1436,8 +1436,8 @@ void start_background_queue(void)
close(pause_pipe[0]);
pause_pipe[0] = -1;
- if (!NT_STATUS_IS_OK(reinit_after_fork(smbd_messaging_context(),
- smbd_event_context(),
+ if (!NT_STATUS_IS_OK(reinit_after_fork(server_messaging_context(),
+ server_event_context(),
true))) {
DEBUG(0,("reinit_after_fork() failed\n"));
smb_panic("reinit_after_fork() failed");
@@ -1455,10 +1455,11 @@ void start_background_queue(void)
exit(1);
}
- messaging_register(smbd_messaging_context(), NULL,
+ messaging_register(server_messaging_context(), NULL,
MSG_PRINTER_UPDATE, print_queue_receive);
- fde = tevent_add_fd(smbd_event_context(), smbd_event_context(),
+ fde = tevent_add_fd(server_event_context(),
+ server_event_context(),
pause_pipe[1], TEVENT_FD_READ,
printing_pause_fd_handler,
NULL);
@@ -1468,7 +1469,7 @@ void start_background_queue(void)
}
DEBUG(5,("start_background_queue: background LPQ thread waiting for messages\n"));
- ret = tevent_loop_wait(smbd_event_context());
+ ret = tevent_loop_wait(server_event_context());
/* should not be reached */
DEBUG(0,("background_queue: tevent_loop_wait() exited with %d - %s\n",
ret, (ret == 0) ? "out of events" : strerror(errno)));
@@ -1601,7 +1602,7 @@ static void print_queue_update(int snum, bool force)
/* finally send the message */
- messaging_send_buf(smbd_messaging_context(),
+ messaging_send_buf(server_messaging_context(),
pid_to_procid(background_lpq_updater_pid),
MSG_PRINTER_UPDATE, (uint8 *)buffer, len);