]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
printing: Remove simple wrapper function pcap_printer_read_fn()
authorVolker Lendecke <vl@samba.org>
Sat, 13 Mar 2021 13:19:23 +0000 (14:19 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 16 Mar 2021 17:09:31 +0000 (17:09 +0000)
There's only one caller that was trivial to convert

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/printing/load.c
source3/printing/pcap.c
source3/printing/pcap.h

index 6a5d4ed97c2c1a6bffafab1bf93d1e8536dd330d..6fabec0fa469473eeef38850af8f2ecabdb905ef 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "includes.h"
 #include "printing/pcap.h"
+#include "printing/printer_list.h"
 #include "printing/load.h"
 #include "lib/param/loadparm.h"
 
@@ -66,13 +67,25 @@ load automatic printer services from pre-populated pcap cache
 ***************************************************************************/
 void load_printers(void)
 {
+       NTSTATUS status;
+
        if (!pcap_cache_loaded(NULL)) {
                return;
        }
 
        add_auto_printers();
 
-       /* load all printcap printers */
-       if (lp_load_printers() && lp_servicenumber(PRINTERS_NAME) >= 0)
-               pcap_printer_read_fn(lp_add_one_printer, NULL);
+       if (!lp_load_printers()) {
+               return;
+       }
+
+       if (lp_servicenumber(PRINTERS_NAME) >= 0) {
+               return;
+       }
+
+       status = printer_list_read_run_fn(lp_add_one_printer, NULL);
+       if (!NT_STATUS_IS_OK(status)) {
+               DBG_NOTICE("printer_list_read_run_fn failed: %s\n",
+                          nt_errstr(status));
+       }
 }
index d771cd9dfeb9e11178a47db736d336cdc9d6c393..3600f9c50fcc9ae6c7c55fff1768edf5c89e975d 100644 (file)
@@ -235,14 +235,3 @@ void pcap_printer_fn_specific(const struct pcap_cache *pc,
 
        return;
 }
-
-void pcap_printer_read_fn(void (*fn)(const char *, const char *, const char *, void *), void *pdata)
-{
-       NTSTATUS status;
-
-       status = printer_list_read_run_fn(fn, pdata);
-       if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(3, ("Failed to run fn for all printers!\n"));
-       }
-       return;
-}
index 8fc9e9de31c2aa570ed04fb65d7dbae2584b0a86..645c1fbc37077658147b6af56ad14f78b6b8db2a 100644 (file)
@@ -38,7 +38,6 @@ void pcap_cache_destroy_specific(struct pcap_cache **ppcache);
 bool pcap_cache_loaded(time_t *_last_change);
 bool pcap_cache_replace(const struct pcap_cache *cache);
 void pcap_printer_fn_specific(const struct pcap_cache *, void (*fn)(const char *, const char *, const char *, void *), void *);
-void pcap_printer_read_fn(void (*fn)(const char *, const char *, const char *, void *), void *);
 
 void pcap_cache_reload(struct tevent_context *ev,
                       struct messaging_context *msg_ctx,