From 4bce271e4fe239a8b4aac2bb65a52165d68d8ea5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 14 Nov 2000 21:56:32 +0000 Subject: Merge from appliance head of JR's changes for driver versioning. Jeremy. (This used to be commit cdbd2e99775642dc2e92004be9014bf38a92d80f) --- source3/printing/printing.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'source3/printing/printing.c') 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; -- cgit