From 071af8f007efc20c23959d140a87cc09363aae83 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 11 Jan 2003 02:38:36 +0000 Subject: [merge] make sure to update print queue cache during timeout_processing() to send notify events; CR 1491 (This used to be commit f8a915b14d63e4fdb99235053eeb896ef9492068) --- source3/printing/printing.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'source3/printing') 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. -- cgit