diff options
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; } |