diff options
author | Gowtham Thommandra <Gowtham.Thommandra@Sun.COM> | 2009-04-16 12:29:02 +0530 |
---|---|---|
committer | Gowtham Thommandra <Gowtham.Thommandra@Sun.COM> | 2009-04-16 12:29:02 +0530 |
commit | 98f04078d5fc5800e80b21e0b18abe0024af1cbe (patch) | |
tree | cc0a3ec30ce5dfe5d659364868690b9a43366c5b /usr/src/cmd/print/bsd-sysv-commands/reject.c | |
parent | c3c82186300a3bf11cfdda43b1cca3cd6b333629 (diff) | |
download | illumos-joyent-98f04078d5fc5800e80b21e0b18abe0024af1cbe.tar.gz |
6739383 print commands accept, reject, disable enable don't report status after execution.
Diffstat (limited to 'usr/src/cmd/print/bsd-sysv-commands/reject.c')
-rw-r--r-- | usr/src/cmd/print/bsd-sysv-commands/reject.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/usr/src/cmd/print/bsd-sysv-commands/reject.c b/usr/src/cmd/print/bsd-sysv-commands/reject.c index 58eb2829d0..777172f2fa 100644 --- a/usr/src/cmd/print/bsd-sysv-commands/reject.c +++ b/usr/src/cmd/print/bsd-sysv-commands/reject.c @@ -20,14 +20,13 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * */ /* $Id: reject.c 146 2006-03-24 00:26:54Z njacobs $ */ -#pragma ident "%Z%%M% %I% %E% SMI" #include <stdio.h> #include <stdlib.h> @@ -49,8 +48,8 @@ usage(char *program) name++; fprintf(stdout, - gettext("Usage: %s destination ...\n"), - name); + gettext("Usage: %s destination ...\n"), + name); exit(1); } @@ -86,18 +85,27 @@ main(int ac, char *av[]) char *printer = av[optind++]; status = papiServiceCreate(&svc, printer, NULL, NULL, - cli_auth_callback, encryption, NULL); + cli_auth_callback, encryption, NULL); if (status != PAPI_OK) { fprintf(stderr, gettext( - "Failed to contact service for %s: %s\n"), - printer, verbose_papi_message(svc, status)); + "Failed to contact service for %s: %s\n"), + printer, verbose_papi_message(svc, status)); exit_status = 1; } status = papiPrinterPause(svc, printer, reason); - if (status != PAPI_OK) { + if (status == PAPI_OK) { + printf(gettext( + "Destination \"%s\" will no longer " + "accept requests\n"), printer); + } else if (status == PAPI_NOT_ACCEPTING) { + fprintf(stderr, gettext( + "Destination \"%s\" was already not " + "accepting requests.\n"), printer); + exit_status = 1; + } else { fprintf(stderr, gettext("reject: %s: %s\n"), printer, - verbose_papi_message(svc, status)); + verbose_papi_message(svc, status)); exit_status = 1; } |