summaryrefslogtreecommitdiff
path: root/usr/src/cmd/print/bsd-sysv-commands/lpstat.c
diff options
context:
space:
mode:
authorsonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>2009-12-24 13:57:19 +0530
committersonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>2009-12-24 13:57:19 +0530
commit06f61b77bc179f185bf19957b30740c246a13c0d (patch)
tree25c0e9de6cc0ceda6a10b7dac4397b5a786ec9d1 /usr/src/cmd/print/bsd-sysv-commands/lpstat.c
parent0c8534400d099a792c36caa2092e30b440db467a (diff)
downloadillumos-joyent-06f61b77bc179f185bf19957b30740c246a13c0d.tar.gz
6869007 Multi print jobs deleted by cancel(1).
6891815 Job can be cancelled by using spool file number even though there is not such a job number
Diffstat (limited to 'usr/src/cmd/print/bsd-sysv-commands/lpstat.c')
-rw-r--r--usr/src/cmd/print/bsd-sysv-commands/lpstat.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr/src/cmd/print/bsd-sysv-commands/lpstat.c b/usr/src/cmd/print/bsd-sysv-commands/lpstat.c
index 2f595103f2..563f82320c 100644
--- a/usr/src/cmd/print/bsd-sysv-commands/lpstat.c
+++ b/usr/src/cmd/print/bsd-sysv-commands/lpstat.c
@@ -1082,7 +1082,6 @@ job_query(char *request, int (*report)(char *, papi_job_t, int, int),
papiJobListFree(jobs);
} else { /* a job */
papi_job_t job = NULL;
- int rid = id;
/* Once a job has been found stop processing */
flag = 0;
@@ -1093,12 +1092,12 @@ job_query(char *request, int (*report)(char *, papi_job_t, int, int),
*/
id = job_to_be_queried(svc, printer, id);
- if (id > 0)
+ if (id >= 0)
status = papiJobQuery(svc, printer, id,
NULL, &job);
else
- status = papiJobQuery(svc, printer, rid,
- NULL, &job);
+ /* id not found */
+ status = PAPI_NOT_FOUND;
if (status != PAPI_OK) {
if (!print_flag)