diff options
author | sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM> | 2009-12-24 13:57:19 +0530 |
---|---|---|
committer | sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM> | 2009-12-24 13:57:19 +0530 |
commit | 06f61b77bc179f185bf19957b30740c246a13c0d (patch) | |
tree | 25c0e9de6cc0ceda6a10b7dac4397b5a786ec9d1 /usr/src/cmd/print/bsd-sysv-commands/cancel.c | |
parent | 0c8534400d099a792c36caa2092e30b440db467a (diff) | |
download | illumos-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/cancel.c')
-rw-r--r-- | usr/src/cmd/print/bsd-sysv-commands/cancel.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/usr/src/cmd/print/bsd-sysv-commands/cancel.c b/usr/src/cmd/print/bsd-sysv-commands/cancel.c index 4031212bd2..aaa48ffa7d 100644 --- a/usr/src/cmd/print/bsd-sysv-commands/cancel.c +++ b/usr/src/cmd/print/bsd-sysv-commands/cancel.c @@ -172,19 +172,26 @@ main(int ac, char *av[]) * corresponding job-id and send it to cancel */ rid = job_to_be_queried(svc, printer, id); - if (rid >= 0) - status = papiJobCancel(svc, printer, rid); - else - status = papiJobCancel(svc, printer, id); - - if (status == PAPI_NOT_AUTHORIZED) { - mesg = papiStatusString(status); - exit_code = 1; - } else if (status != PAPI_OK) { - mesg = verbose_papi_message(svc, status); + if (rid < 0) { + /* + * Either it is a remote job which cannot be + * cancelled based on job-id or job-id is + * not found + */ exit_code = 1; + fprintf(OUT, "%s-%d: not-found\n", printer, id); + } else { + status = papiJobCancel(svc, printer, rid); + if (status == PAPI_NOT_AUTHORIZED) { + mesg = papiStatusString(status); + exit_code = 1; + } else if (status != PAPI_OK) { + mesg = + verbose_papi_message(svc, status); + exit_code = 1; + } + fprintf(OUT, "%s-%d: %s\n", printer, id, mesg); } - fprintf(OUT, "%s-%d: %s\n", printer, id, mesg); } else { /* it's a printer */ if (user == NULL) { |