void load_printers(struct tevent_context *ev,
struct messaging_context *msg_ctx)
{
- SMB_ASSERT(pcap_cache_loaded());
+ SMB_ASSERT(pcap_cache_loaded(NULL));
add_auto_printers();
*pp_cache = NULL;
}
-bool pcap_cache_loaded(void)
+bool pcap_cache_loaded(time_t *_last_change)
{
NTSTATUS status;
time_t last;
status = printer_list_get_last_refresh(&last);
- return NT_STATUS_IS_OK(status);
+ if (!NT_STATUS_IS_OK(status)) {
+ return false;
+ }
+ if (_last_change != NULL) {
+ *_last_change = last;
+ }
+ return true;
}
bool pcap_cache_replace(const struct pcap_cache *pcache)
bool pcap_cache_add_specific(struct pcap_cache **ppcache, const char *name, const char *comment, const char *location);
void pcap_cache_destroy_specific(struct pcap_cache **ppcache);
-bool pcap_cache_loaded(void);
+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 *);
bool force)
{
if (background_lpq_updater_pid != -1) {
- if (pcap_cache_loaded()) {
+ if (pcap_cache_loaded(NULL)) {
load_printers(ev_ctx, msg_ctx);
}
if (force) {
* If so then we probably missed a message and should load_printers()
* ourselves. If pcap has not been loaded yet, then ignore, we will get
* a message as soon as the bq process completes the reload. */
- if (pcap_cache_loaded()) {
+ if (pcap_cache_loaded(NULL)) {
load_printers(ev_ctx, msg_ctx);
}
* If pcap has not been loaded yet, then ignore, as we will reload on
* client enumeration anyway.
*/
- if (pcap_cache_loaded()) {
+ if (pcap_cache_loaded(NULL)) {
load_printers(ev_ctx, msg_ctx);
}