summaryrefslogtreecommitdiff
path: root/usr/src/cmd/print/bsd-sysv-commands/lpstat.c
diff options
context:
space:
mode:
authorsonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>2010-03-29 20:59:36 +0530
committersonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>2010-03-29 20:59:36 +0530
commitc7f2fd24c9b933d8806de9016fb9bca3f269a8af (patch)
treec175c9baa36d9de3dac3d5b0cb6563d0ea6b2196 /usr/src/cmd/print/bsd-sysv-commands/lpstat.c
parent567c0b92c2af3154cccac71336940521945f8ae8 (diff)
downloadillumos-gate-c7f2fd24c9b933d8806de9016fb9bca3f269a8af.tar.gz
6919676 lpstat output message under powersave mode need to be fixed
Diffstat (limited to 'usr/src/cmd/print/bsd-sysv-commands/lpstat.c')
-rw-r--r--usr/src/cmd/print/bsd-sysv-commands/lpstat.c48
1 files changed, 34 insertions, 14 deletions
diff --git a/usr/src/cmd/print/bsd-sysv-commands/lpstat.c b/usr/src/cmd/print/bsd-sysv-commands/lpstat.c
index 563f82320c..6f666bcc03 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 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
@@ -406,6 +406,7 @@ report_printer(papi_service_t svc, char *name, papi_printer_t printer,
printf(gettext("is idle. enabled"));
break;
case 0x04: /* processing */
+ case 0x06: /* faulted printing */
status = papiPrinterListJobs(svc, name, NULL,
0, 0, &j);
@@ -445,10 +446,16 @@ report_printer(papi_service_t svc, char *name, papi_printer_t printer,
if ((jstate == 0x0008) ||
(jstate == 0x05) ||
(jstate == 0)) {
- printf(gettext
- ("now printing"\
- " %s-%d. enabled"),
- name, jobid);
+ if (pstat == 0x04)
+ printf(gettext
+ ("now printing"\
+ " %s-%d. enabled"),
+ name, jobid);
+ if (pstat == 0x06)
+ printf(gettext
+ ("faulted printing"\
+ " %s-%d. enabled"),
+ name, jobid);
break;
}
}
@@ -459,21 +466,34 @@ report_printer(papi_service_t svc, char *name, papi_printer_t printer,
case 0x05: /* stopped */
printf(gettext("disabled"));
break;
+ case 0x07: /* faulted printer */
+ printf(gettext("faulted. enabled"));
+ break;
+ case 0x08: /* waiting for auto retry */
+ printf(gettext("waiting for auto-retry."));
+ break;
default:
printf(gettext("unknown state(0x%x)."), pstat);
break;
}
- (void) time(&curr);
- (void) papiAttributeListGetDatetime(attrs, NULL,
- "printer-up-time", &curr);
- (void) papiAttributeListGetDatetime(attrs, NULL,
- "printer-state-time", &curr);
- (void) papiAttributeListGetDatetime(attrs, NULL,
- "lpsched-disable-date", &curr);
- printf(gettext(" since %s. available.\n"), nctime(&curr));
+ if (pstat == 0x08)
+ printf(gettext(" available.\n"));
+ else {
+ (void) time(&curr);
+ (void) papiAttributeListGetDatetime(attrs, NULL,
+ "printer-up-time", &curr);
+ (void) papiAttributeListGetDatetime(attrs, NULL,
+ "printer-state-time", &curr);
+ (void) papiAttributeListGetDatetime(attrs, NULL,
+ "lpsched-disable-date", &curr);
+ printf(gettext(" since %s. available.\n"), nctime(&curr));
+ }
- if (pstat == 0x05) {
+ if ((pstat == 0x05) ||
+ (pstat == 0x06) ||
+ (pstat == 0x07) ||
+ (pstat == 0x08)) {
char *reason = "unknown reason";
(void) papiAttributeListGetString(attrs, NULL,