diff options
author | sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM> | 2009-04-10 11:36:51 +0530 |
---|---|---|
committer | sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM> | 2009-04-10 11:36:51 +0530 |
commit | 40e7ce05bde825a43b0db32ded62db8cc5b6ec9c (patch) | |
tree | 3e7d4fd0b9ab91c765de066fdc16e2c2d20bea99 /usr/src | |
parent | 35c620948de04c617711d72b089052077e73732e (diff) | |
download | illumos-gate-40e7ce05bde825a43b0db32ded62db8cc5b6ec9c.tar.gz |
6808025 Incomplete fix for 6699255
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/lp/lib/papi/printer.c | 12 | ||||
-rw-r--r-- | usr/src/cmd/print/bsd-sysv-commands/common.c | 6 | ||||
-rw-r--r-- | usr/src/cmd/print/bsd-sysv-commands/lpstat.c | 3 |
3 files changed, 12 insertions, 9 deletions
diff --git a/usr/src/cmd/lp/lib/papi/printer.c b/usr/src/cmd/lp/lib/papi/printer.c index 2ba4b90628..5a3fba075a 100644 --- a/usr/src/cmd/lp/lib/papi/printer.c +++ b/usr/src/cmd/lp/lib/papi/printer.c @@ -23,7 +23,6 @@ * Use is subject to license terms. */ - /*LINTLIBRARY*/ #include <stdlib.h> @@ -459,6 +458,7 @@ papiPrinterListJobs(papi_service_t handle, char *name, *owner = NULL, *slabel = NULL, *file = NULL; + char request_file[128]; time_t date = 0; size_t size = 0; short rank = 0, state = 0; @@ -482,12 +482,14 @@ papiPrinterListJobs(papi_service_t handle, char *name, if ((job = calloc(1, sizeof (*job))) == NULL) continue; - if ((ptr = strrchr(file, '-')) != NULL) { - *++ptr = '0'; - *++ptr = NULL; + /* Request file is <req_id>-0 */ + if ((ptr = strrchr(req_id, '-')) != NULL) { + ++ptr; + snprintf(request_file, sizeof (request_file), + "%s-0", ptr); } - lpsched_read_job_configuration(svc, job, file); + lpsched_read_job_configuration(svc, job, request_file); job_status_to_attributes(job, req_id, owner, slabel, size, date, state, dest, form, charset, rank, file); diff --git a/usr/src/cmd/print/bsd-sysv-commands/common.c b/usr/src/cmd/print/bsd-sysv-commands/common.c index ca60249bd9..8b4f50bdc8 100644 --- a/usr/src/cmd/print/bsd-sysv-commands/common.c +++ b/usr/src/cmd/print/bsd-sysv-commands/common.c @@ -258,10 +258,10 @@ cancel_job(papi_service_t svc, FILE *fp, char *printer, papi_job_t job, if (status != PAPI_OK) mesg = papiStatusString(status); - if (id != 0) - fprintf(fp, "%s-%d: %s\n", printer, id, mesg); - else + if (rid != 0) fprintf(fp, "%s-%d: %s\n", printer, rid, mesg); + else + fprintf(fp, "%s-%d: %s\n", printer, id, mesg); } int diff --git a/usr/src/cmd/print/bsd-sysv-commands/lpstat.c b/usr/src/cmd/print/bsd-sysv-commands/lpstat.c index 9e446bee19..94c3b7b98f 100644 --- a/usr/src/cmd/print/bsd-sysv-commands/lpstat.c +++ b/usr/src/cmd/print/bsd-sysv-commands/lpstat.c @@ -794,6 +794,8 @@ report_job(char *printer, papi_job_t job, int show_rank, int verbose) "printer-name", &destination); (void) papiAttributeListGetInteger(attrs, NULL, "job-id", &id); + (void) papiAttributeListGetInteger(attrs, NULL, + "job-id-requested", &id); snprintf(request, sizeof (request), "%s-%d", printer, id); @@ -811,7 +813,6 @@ report_job(char *printer, papi_job_t job, int show_rank, int verbose) (void) papiAttributeListGetInteger(attrs, NULL, "job-state", &jstate); - if (jstate == 0x0001) printf(gettext(" being held")); else if (jstate == 0x0800) |