summaryrefslogtreecommitdiff
path: root/source3/printing/pcap.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-05-14 15:49:29 -0400
committerAndreas Schneider <asn@samba.org>2010-09-15 12:53:40 +0200
commit25a2d94974c7befd13f90e52b61e297c31ae52e9 (patch)
tree8f3d136d20a85b5da954295e75e03e91dde71a03 /source3/printing/pcap.c
parent7022554915a0dc7522151eb2a9a21317372471b9 (diff)
downloadsamba-25a2d94974c7befd13f90e52b61e297c31ae52e9.tar.gz
samba-25a2d94974c7befd13f90e52b61e297c31ae52e9.tar.bz2
samba-25a2d94974c7befd13f90e52b61e297c31ae52e9.zip
s3-printing: Add method to skip refresh if just happned.
This way if multiple process try to refresh at the same time we don't do it over and over again. Signed-off-by: Andreas Schneider <asn@cynapses.org>
Diffstat (limited to 'source3/printing/pcap.c')
-rw-r--r--source3/printing/pcap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/printing/pcap.c b/source3/printing/pcap.c
index 2e544b7cdc..3bc8e9e4e2 100644
--- a/source3/printing/pcap.c
+++ b/source3/printing/pcap.c
@@ -121,6 +121,12 @@ void pcap_cache_reload(struct tevent_context *ev,
return;
}
+ if (!printer_list_need_refresh()) {
+ /* has been just refeshed, skip */
+ DEBUG(5, ("Refresh just happend, skipping.\n"));
+ return;
+ }
+
status = printer_list_mark_reload();
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("Failed to mark printer list for reload!\n"));