summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorDavid O'Neill <dmo@samba.org>2000-12-13 21:24:06 +0000
committerDavid O'Neill <dmo@samba.org>2000-12-13 21:24:06 +0000
commit2e87e6e8c88bde725bbd73e9ca1b31384128a299 (patch)
tree7325b0957df5cdbb4b0be0e793c1bf38850354c9 /source3
parent5c67f8de461c439ec4fba7db1b33f8d2fed245c5 (diff)
downloadsamba-2e87e6e8c88bde725bbd73e9ca1b31384128a299.tar.gz
samba-2e87e6e8c88bde725bbd73e9ca1b31384128a299.tar.bz2
samba-2e87e6e8c88bde725bbd73e9ca1b31384128a299.zip
Changes from APPLIANCE_HEAD:
- trivial typo in definition of enum_printing[] (source/param/loadparm.c) - fixed printer status display bug. When no jobs existed in queue, the clients were not properly notified of printer status. This caused native tools for pausing/unpausing a print queue to not work. (source/printing/printing.c) (This used to be commit c533e77f1912618230a938458980a9339924fe06)
Diffstat (limited to 'source3')
-rw-r--r--source3/param/loadparm.c2
-rw-r--r--source3/printing/printing.c33
2 files changed, 20 insertions, 15 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 4a6ec83607..d5a032c26b 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -560,7 +560,7 @@ static struct enum_list enum_printing[] = {
{PRINT_LPROS2, "os2"},
#ifdef DEVELOPER
{PRINT_TEST, "test"},
- {PRINT_TEST, "vlp"},
+ {PRINT_VLP, "vlp"},
#endif /* DEVELOPER */
{-1, NULL}
};
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index e8dc4d7f34..b670908049 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -1058,10 +1058,28 @@ int print_queue_status(int snum,
*queue = NULL;
/*
- * Count the number of entries.
+ * Fetch the queue status. We must do this first, as there may
+ * be no jobs in the queue.
+ */
+ ZERO_STRUCTP(status);
+ slprintf(keystr, sizeof(keystr), "STATUS/%s", lp_servicename(snum));
+ key.dptr = keystr;
+ key.dsize = strlen(keystr);
+ data = tdb_fetch(tdb, key);
+ if (data.dptr) {
+ if (data.dsize == sizeof(*status)) {
+ memcpy(status, data.dptr, sizeof(*status));
+ }
+ free(data.dptr);
+ }
+
+ /*
+ * Now, fetch the print queue information. We first count the number
+ * of entries, and then only retrieve the queue if necessary.
*/
tsc.count = 0;
tsc.snum = snum;
+
tdb_traverse(tdb, traverse_count_fn_queue, (void *)&tsc);
if (tsc.count == 0)
@@ -1084,19 +1102,6 @@ int print_queue_status(int snum,
tdb_traverse(tdb, traverse_fn_queue, (void *)&tstruct);
- /* also fetch the queue status */
- ZERO_STRUCTP(status);
- slprintf(keystr, sizeof(keystr), "STATUS/%s", lp_servicename(snum));
- key.dptr = keystr;
- key.dsize = strlen(keystr);
- data = tdb_fetch(tdb, key);
- if (data.dptr) {
- if (data.dsize == sizeof(*status)) {
- memcpy(status, data.dptr, sizeof(*status));
- }
- free(data.dptr);
- }
-
/* Sort the queue by submission time otherwise they are displayed
in hash order. */