summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-01-11 02:38:36 +0000
committerGerald Carter <jerry@samba.org>2003-01-11 02:38:36 +0000
commit071af8f007efc20c23959d140a87cc09363aae83 (patch)
treed791fda875827a93367d35e319930d64d632eb3f /source3/printing
parentbb697d25c7592d63074266092d458cec28ef23dc (diff)
downloadsamba-071af8f007efc20c23959d140a87cc09363aae83.tar.gz
samba-071af8f007efc20c23959d140a87cc09363aae83.tar.bz2
samba-071af8f007efc20c23959d140a87cc09363aae83.zip
[merge] make sure to update print queue cache during timeout_processing() to send notify events; CR 1491
(This used to be commit f8a915b14d63e4fdb99235053eeb896ef9492068)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index be42664b56..a770e7a09a 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -1907,6 +1907,7 @@ static int printjob_comp(print_queue_struct *j1, print_queue_struct *j2)
/****************************************************************************
Get a printer queue listing.
+ set queue = NULL and status = NULL if you just want to update the cache
****************************************************************************/
int print_queue_status(int snum,
@@ -1917,18 +1918,26 @@ int print_queue_status(int snum,
struct traverse_count_struct tsc;
fstring keystr;
TDB_DATA data, key;
- const char *printername = lp_const_servicename(snum);
- struct tdb_print_db *pdb = get_print_db_byname(printername);
+ const char *printername;
+ struct tdb_print_db *pdb;
+
+ /* make sure the database is up to date */
+
+ if (print_cache_expired(snum))
+ print_queue_update(snum);
+
+ /* return if we are done */
+
+ if ( !queue || !status )
+ return 0;
*queue = NULL;
+ printername = lp_const_servicename(snum);
+ pdb = get_print_db_byname(printername);
if (!pdb)
return 0;
- /* make sure the database is up to date */
- if (print_cache_expired(snum))
- print_queue_update(snum);
-
/*
* Fetch the queue status. We must do this first, as there may
* be no jobs in the queue.