summaryrefslogtreecommitdiff
path: root/usr/src/cmd/print/bsd-sysv-commands/lpstat.c
diff options
context:
space:
mode:
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)