[PATCH 5/6] s3-printing: add status argument to printcap callback

David Disseldorp ddiss at suse.de
Fri Jun 17 05:39:20 MDT 2011


---
 source3/printing/pcap.c           |    5 +++--
 source3/printing/pcap.h           |    6 ++++--
 source3/printing/print_cups.c     |    9 ++++++---
 source3/printing/spoolssd.c       |    3 ++-
 source3/rpc_server/rpc_ep_setup.c |    3 ++-
 source3/smbd/proto.h              |    3 ++-
 source3/smbd/server_reload.c      |    3 ++-
 7 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/source3/printing/pcap.c b/source3/printing/pcap.c
index 62db4f5..0a5f7a9 100644
--- a/source3/printing/pcap.c
+++ b/source3/printing/pcap.c
@@ -128,7 +128,8 @@ bool pcap_cache_replace(const struct pcap_cache *pcache)
 void pcap_cache_reload(struct tevent_context *ev,
 		       struct messaging_context *msg_ctx,
 		       void (*post_cache_fill_fn)(struct tevent_context *,
-						  struct messaging_context *))
+						  struct messaging_context *,
+						  bool))
 {
 	const char *pcap_name = lp_printcapname();
 	bool pcap_reloaded = False;
@@ -197,7 +198,7 @@ done:
 			DEBUG(0, ("Failed to cleanup printer list!\n"));
 		}
 		if (post_cache_fill_fn != NULL) {
-			post_cache_fill_fn(ev, msg_ctx);
+			post_cache_fill_fn(ev, msg_ctx, pcap_reloaded);
 		}
 	}
 
diff --git a/source3/printing/pcap.h b/source3/printing/pcap.h
index 63497fd..b75a763 100644
--- a/source3/printing/pcap.h
+++ b/source3/printing/pcap.h
@@ -31,7 +31,8 @@ void pcap_printer_fn(void (*fn)(const char *, const char *, const char *, void *
 void pcap_cache_reload(struct tevent_context *ev,
 		       struct messaging_context *msg_ctx,
 		       void (*post_cache_fill_fn)(struct tevent_context *,
-						  struct messaging_context *));
+						  struct messaging_context *,
+						  bool));
 bool pcap_printername_ok(const char *printername);
 
 /* The following definitions come from printing/print_aix.c  */
@@ -43,7 +44,8 @@ bool aix_cache_reload(void);
 bool cups_cache_reload(struct tevent_context *ev,
 		       struct messaging_context *msg_ctx,
 		       void (*post_cache_fill_fn)(struct tevent_context *,
-						  struct messaging_context *));
+						  struct messaging_context *,
+						  bool));
 
 /* The following definitions come from printing/print_iprint.c  */
 
diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c
index ff19de2..4453801 100644
--- a/source3/printing/print_cups.c
+++ b/source3/printing/print_cups.c
@@ -450,7 +450,8 @@ struct cups_async_cb_args {
 	struct event_context *event_ctx;
 	struct messaging_context *msg_ctx;
 	void (*post_cache_fill_fn)(struct event_context *,
-				   struct messaging_context *);
+				   struct messaging_context *,
+				   bool);
 };
 
 static void cups_async_callback(struct event_context *event_ctx,
@@ -506,7 +507,8 @@ static void cups_async_callback(struct event_context *event_ctx,
 	} else if (cb_args->post_cache_fill_fn != NULL) {
 		/* Caller requested post cache fill callback */
 		cb_args->post_cache_fill_fn(cb_args->event_ctx,
-					    cb_args->msg_ctx);
+					    cb_args->msg_ctx,
+					    ret_ok);
 	}
 err_out:
 	pcap_cache_destroy_specific(&tmp_pcap_cache);
@@ -519,7 +521,8 @@ err_out:
 bool cups_cache_reload(struct tevent_context *ev,
 		       struct messaging_context *msg_ctx,
 		       void (*post_cache_fill_fn)(struct tevent_context *,
-						  struct messaging_context *))
+						  struct messaging_context *,
+						  bool))
 {
 	struct cups_async_cb_args *cb_args;
 	int *p_pipe_fd;
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c
index 028d357..a32f229 100644
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -133,7 +133,8 @@ static void spoolss_setup_sig_hup_handler(struct tevent_context *ev_ctx,
 }
 
 static void spoolss_init_pcap_cb(struct tevent_context *ev,
-				 struct messaging_context *msg_ctx)
+				 struct messaging_context *msg_ctx,
+				 bool reload_ok)
 {
 	bool ok;
 
diff --git a/source3/rpc_server/rpc_ep_setup.c b/source3/rpc_server/rpc_ep_setup.c
index bf8134a..1a68451 100644
--- a/source3/rpc_server/rpc_ep_setup.c
+++ b/source3/rpc_server/rpc_ep_setup.c
@@ -658,7 +658,8 @@ static bool netlogon_init_cb(void *ptr)
 }
 
 static void spoolss_init_pcap_cb(struct tevent_context *ev,
-				 struct messaging_context *msg_ctx)
+				 struct messaging_context *msg_ctx,
+				 bool reload_ok)
 {
 	bool ok;
 
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index cff417b..bd8658b 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -927,7 +927,8 @@ void reload_printers(struct tevent_context *ev,
 bool reload_services(struct messaging_context *msg_ctx, int smb_sock,
 		     bool test);
 void reload_pcap_change_notify(struct tevent_context *ev,
-			       struct messaging_context *msg_ctx);
+			       struct messaging_context *msg_ctx,
+			       bool reload_ok);
 void exit_server(const char *const explanation);
 void exit_server_cleanly(const char *const explanation);
 void exit_server_fault(void);
diff --git a/source3/smbd/server_reload.c b/source3/smbd/server_reload.c
index 82b0cb0..9386eb1 100644
--- a/source3/smbd/server_reload.c
+++ b/source3/smbd/server_reload.c
@@ -143,7 +143,8 @@ bool reload_services(struct messaging_context *msg_ctx, int smb_sock,
  Notify smbds of new printcap data
 **************************************************************************/
 void reload_pcap_change_notify(struct tevent_context *ev,
-			       struct messaging_context *msg_ctx)
+			       struct messaging_context *msg_ctx,
+			       bool reload_ok)
 {
 	message_send_all(msg_ctx, MSG_PRINTER_PCAP, NULL, 0, NULL);
 }
-- 
1.7.1



More information about the samba-technical mailing list