summaryrefslogtreecommitdiffstats
path: root/source3/printing/pcap.c
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2014-07-25 12:18:54 +0200
committerAndreas Schneider <asn@cryptomilk.org>2014-08-08 14:10:39 +0200
commit6d75e20ca8acf1a55838694ac77940e21e9a1e6a (patch)
treecd9f4331ecd05605ae84203096e8bd21a10ee221 /source3/printing/pcap.c
parente5e6e2c796f026ee6b04f99b327941d57b9bd026 (diff)
downloadsamba-6d75e20ca8acf1a55838694ac77940e21e9a1e6a.tar.gz
samba-6d75e20ca8acf1a55838694ac77940e21e9a1e6a.tar.xz
samba-6d75e20ca8acf1a55838694ac77940e21e9a1e6a.zip
printing: remove pcap_cache_add()
All print list updates are now done via pcap_cache_replace(), which can call into the print_list code directly. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/printing/pcap.c')
-rw-r--r--source3/printing/pcap.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/source3/printing/pcap.c b/source3/printing/pcap.c
index 0c4bf40554..9c44584a4d 100644
--- a/source3/printing/pcap.c
+++ b/source3/printing/pcap.c
@@ -83,15 +83,6 @@ void pcap_cache_destroy_specific(struct pcap_cache **pp_cache)
*pp_cache = NULL;
}
-static bool pcap_cache_add(const char *name, const char *comment, const char *location)
-{
- NTSTATUS status;
- time_t t = time_mono(NULL);
-
- status = printer_list_set_printer(talloc_tos(), name, comment, location, t);
- return NT_STATUS_IS_OK(status);
-}
-
bool pcap_cache_loaded(void)
{
NTSTATUS status;
@@ -105,6 +96,7 @@ bool pcap_cache_replace(const struct pcap_cache *pcache)
{
const struct pcap_cache *p;
NTSTATUS status;
+ time_t t = time_mono(NULL);
status = printer_list_mark_reload();
if (!NT_STATUS_IS_OK(status)) {
@@ -113,7 +105,11 @@ bool pcap_cache_replace(const struct pcap_cache *pcache)
}
for (p = pcache; p; p = p->next) {
- pcap_cache_add(p->name, p->comment, p->location);
+ status = printer_list_set_printer(talloc_tos(), p->name,
+ p->comment, p->location, t);
+ if (!NT_STATUS_IS_OK(status)) {
+ return false;
+ }
}
status = printer_list_clean_old();