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/accept.c | |
parent | c3c82186300a3bf11cfdda43b1cca3cd6b333629 (diff) | |
download | illumos-gate-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/accept.c')
-rw-r--r-- | usr/src/cmd/print/bsd-sysv-commands/accept.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/usr/src/cmd/print/bsd-sysv-commands/accept.c b/usr/src/cmd/print/bsd-sysv-commands/accept.c index c20f9344de..903d7728ba 100644 --- a/usr/src/cmd/print/bsd-sysv-commands/accept.c +++ b/usr/src/cmd/print/bsd-sysv-commands/accept.c @@ -20,15 +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: accept.c 146 2006-03-24 00:26:54Z njacobs $ */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -49,8 +47,8 @@ usage(char *program) name++; fprintf(stdout, - gettext("Usage: %s destination ...\n"), - name); + gettext("Usage: %s destination ...\n"), + name); exit(1); } @@ -82,18 +80,27 @@ main(int ac, char *av[]) char *printer = av[c]; 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 = papiPrinterResume(svc, printer); - if (status != PAPI_OK) { + if (status == PAPI_OK) { + printf(gettext( + "Destination \"%s\" now accepting requests\n"), + printer); + } else if (status == PAPI_NOT_ACCEPTING) { + fprintf(stderr, gettext( + "Destination \"%s\" was already " + "accepting requests.\n"), printer); + exit_status = 1; + } else { fprintf(stderr, gettext("accept: %s: %s\n"), printer, - verbose_papi_message(svc, status)); + verbose_papi_message(svc, status)); exit_status = 1; } |