diff options
author | sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM> | 2008-12-09 03:48:35 -0800 |
---|---|---|
committer | sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM> | 2008-12-09 03:48:35 -0800 |
commit | b9c04f6bfa1f46f260b6c31fba3a4fb3ed016a25 (patch) | |
tree | 799766e87b7ab8e4e24992040238dd60c27b607e /usr/src/cmd/print/bsd-sysv-commands | |
parent | 79ce5f026bed2742bce5c83afcfa9ffc32fc99de (diff) | |
download | illumos-gate-b9c04f6bfa1f46f260b6c31fba3a4fb3ed016a25.tar.gz |
6749323 s10u5: 'lpstat -o' doesnot display the host info along with the owner of the request
Diffstat (limited to 'usr/src/cmd/print/bsd-sysv-commands')
-rw-r--r-- | usr/src/cmd/print/bsd-sysv-commands/lpstat.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/usr/src/cmd/print/bsd-sysv-commands/lpstat.c b/usr/src/cmd/print/bsd-sysv-commands/lpstat.c index e3ba272bc9..cd69b4efed 100644 --- a/usr/src/cmd/print/bsd-sysv-commands/lpstat.c +++ b/usr/src/cmd/print/bsd-sysv-commands/lpstat.c @@ -633,8 +633,10 @@ report_job(papi_job_t job, int show_rank, int verbose) char date[24]; char request[26]; char *user = "unknown"; + char *host = NULL; int32_t size = 0; int32_t jstate = 0; + char User[50]; char *destination = "unknown"; int32_t id = -1; @@ -645,6 +647,14 @@ report_job(papi_job_t job, int show_rank, int verbose) if ((users != NULL) && (match_user(user, users) < 0)) return (0); + (void) papiAttributeListGetString(attrs, NULL, + "job-originating-host-name", &host); + + if (host) + snprintf(User, sizeof (User), "%s@%s", user, host); + else + snprintf(User, sizeof (User), "%s", user); + (void) papiAttributeListGetInteger(attrs, NULL, "job-k-octets", &size); size *= 1024; /* for the approximate byte size */ (void) papiAttributeListGetInteger(attrs, NULL, "job-octets", &size); @@ -670,9 +680,9 @@ report_job(papi_job_t job, int show_rank, int verbose) rank++; printf("%3d %-21s %-14s %7ld %s", - rank, request, user, size, date); + rank, request, User, size, date); } else - printf("%-23s %-14s %7ld %s", request, user, size, date); + printf("%-23s %-14s %7ld %s", request, User, size, date); (void) papiAttributeListGetInteger(attrs, NULL, "job-state", &jstate); |