summaryrefslogtreecommitdiff
path: root/source3/printing/printing.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-11-14 21:56:32 +0000
committerJeremy Allison <jra@samba.org>2000-11-14 21:56:32 +0000
commit4bce271e4fe239a8b4aac2bb65a52165d68d8ea5 (patch)
tree6a5c218ce4c96dc6375833e290a84be9f5970b50 /source3/printing/printing.c
parent47dc568a3b44b89ca6a4238bb8f0030dae4ba9b1 (diff)
downloadsamba-4bce271e4fe239a8b4aac2bb65a52165d68d8ea5.tar.gz
samba-4bce271e4fe239a8b4aac2bb65a52165d68d8ea5.tar.bz2
samba-4bce271e4fe239a8b4aac2bb65a52165d68d8ea5.zip
Merge from appliance head of JR's changes for driver versioning.
Jeremy. (This used to be commit cdbd2e99775642dc2e92004be9014bf38a92d80f)
Diffstat (limited to 'source3/printing/printing.c')
-rw-r--r--source3/printing/printing.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 95bcf2a276..8b17e8d5f2 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -305,15 +305,17 @@ static void print_queue_update(int snum)
print_status_struct status;
struct printjob *pjob;
struct traverse_struct tstruct;
- fstring keystr;
+ fstring keystr, printer_name;
TDB_DATA data, key;
+ fstrcpy(printer_name, lp_servicename(snum));
+
/*
* Update the cache time FIRST ! Stops others doing this
* if the lpq takes a long time.
*/
- slprintf(keystr, sizeof(keystr), "CACHE/%s", lp_servicename(snum));
+ slprintf(keystr, sizeof(keystr), "CACHE/%s", printer_name);
tdb_store_int(tdb, keystr, (int)time(NULL));
slprintf(tmp_file, sizeof(tmp_file), "%s/smblpq.%d", path, local_pid);
@@ -343,11 +345,11 @@ static void print_queue_update(int snum)
file_lines_free(qlines);
DEBUG(3, ("%d job%s in queue for %s\n", qcount, (qcount != 1) ?
- "s" : "", lp_servicename(snum)));
+ "s" : "", printer_name));
/* Lock the queue for the database update */
- slprintf(keystr, sizeof(keystr) - 1, "LOCK/%s", lp_servicename(snum));
+ slprintf(keystr, sizeof(keystr) - 1, "LOCK/%s", printer_name);
tdb_lock_bystring(tdb, keystr);
/*
@@ -397,7 +399,7 @@ static void print_queue_update(int snum)
/* store the queue status structure */
status.qcount = qcount;
- slprintf(keystr, sizeof(keystr), "STATUS/%s", lp_servicename(snum));
+ slprintf(keystr, sizeof(keystr), "STATUS/%s", printer_name);
data.dptr = (void *)&status;
data.dsize = sizeof(status);
key.dptr = keystr;
@@ -406,7 +408,7 @@ static void print_queue_update(int snum)
/* Unlock for database update */
- slprintf(keystr, sizeof(keystr) - 1, "LOCK/%s", lp_servicename(snum));
+ slprintf(keystr, sizeof(keystr) - 1, "LOCK/%s", printer_name);
tdb_unlock_bystring(tdb, keystr);
/*
@@ -414,7 +416,7 @@ static void print_queue_update(int snum)
* as little as possible...
*/
- slprintf(keystr, sizeof(keystr), "CACHE/%s", lp_servicename(snum));
+ slprintf(keystr, sizeof(keystr), "CACHE/%s", printer_name);
tdb_store_int(tdb, keystr, (int)time(NULL));
}
@@ -1032,7 +1034,8 @@ int print_queue_status(int snum,
return 0;
/* Allocate the queue size. */
- if (( tstruct.queue = (print_queue_struct *)malloc(sizeof(print_queue_struct)*tsc.count))
+ if ((tstruct.queue = (print_queue_struct *)
+ malloc(sizeof(print_queue_struct)*tsc.count))
== NULL)
return 0;