summaryrefslogtreecommitdiff
path: root/source3/printing/print_cups.c
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2010-12-28 14:55:01 +0100
committerJeremy Allison <jra@samba.org>2011-01-07 15:37:39 -0800
commitff577762b9cb37355f9433850b2119a6411e21da (patch)
tree138a2a45c4d6d322e0fc5c610069d5592b44c72f /source3/printing/print_cups.c
parent0b188e7784a3f58810f871bf63d10d8a691ecbae (diff)
downloadsamba-ff577762b9cb37355f9433850b2119a6411e21da.tar.gz
s3-printing: remove old entries in pcap_cache_replace
Callers of pcap_cache_replace() assume the existing printcap cache is replaced by the new values provided. This is not currently the case, old entries should be removed.
Diffstat (limited to 'source3/printing/print_cups.c')
-rw-r--r--source3/printing/print_cups.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c
index 8c023ddb300..0e5dac53746 100644
--- a/source3/printing/print_cups.c
+++ b/source3/printing/print_cups.c
@@ -552,15 +552,18 @@ static void cups_async_callback(struct event_context *event_ctx,
TALLOC_FREE(frame);
if (tmp_pcap_cache) {
+ bool ret;
/* We got a namelist, replace our local cache. */
pcap_cache_destroy_specific(&local_pcap_copy);
local_pcap_copy = tmp_pcap_cache;
/* And the systemwide pcap cache. */
- pcap_cache_replace(local_pcap_copy);
+ ret = pcap_cache_replace(local_pcap_copy);
+ if (!ret)
+ DEBUG(0, ("failed to replace pcap cache\n"));
/* Caller may have requested post cache fill callback */
- if (cb_args->post_cache_fill_fn != NULL) {
+ if (ret && cb_args->post_cache_fill_fn != NULL) {
cb_args->post_cache_fill_fn(cb_args->event_ctx,
cb_args->msg_ctx);
}
@@ -611,10 +614,6 @@ bool cups_cache_reload(struct tevent_context *ev,
return false;
}
} else {
- /* Replace the system cache with our
- * local copy. */
- pcap_cache_replace(local_pcap_copy);
-
DEBUG(10,("cups_cache_reload: async read on fd %d\n",
*p_pipe_fd ));