From 022ba35cdbb5905f91897d5ebec60427a5bc8a16 Mon Sep 17 00:00:00 2001 From: jacobs Date: Wed, 18 Apr 2007 21:01:55 -0700 Subject: 6526418 netpr dumps core when protocol is tcp and port number is missing 6530757 creating print queue with lexmarks print driver --- usr/src/cmd/print/bsd-sysv-commands/lpstat.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'usr/src/cmd/print/bsd-sysv-commands/lpstat.c') diff --git a/usr/src/cmd/print/bsd-sysv-commands/lpstat.c b/usr/src/cmd/print/bsd-sysv-commands/lpstat.c index 4d0b350fd4..803ddfa6b6 100644 --- a/usr/src/cmd/print/bsd-sysv-commands/lpstat.c +++ b/usr/src/cmd/print/bsd-sysv-commands/lpstat.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * */ @@ -533,10 +533,14 @@ printer_query(char *name, int (*report)(papi_service_t, char *, papi_printer_t, status = papiServiceCreate(&svc, name, NULL, NULL, cli_auth_callback, encryption, NULL); if (status != PAPI_OK) { - fprintf(stderr, gettext( - "Failed to contact service for %s: %s\n"), - name ? name : "(NULL)", - verbose_papi_message(svc, status)); + if (status == PAPI_NOT_FOUND) + fprintf(stderr, gettext("%s: unknown printer\n"), + name ? name : "(NULL)"); + else + fprintf(stderr, gettext( + "Failed to contact service for %s: %s\n"), + name ? name : "(NULL)", + verbose_papi_message(svc, status)); papiServiceDestroy(svc); return (-1); } -- cgit v1.2.3