diff options
Diffstat (limited to 'berkeley')
-rw-r--r-- | berkeley/lpq.c | 14 | ||||
-rw-r--r-- | berkeley/lpr.c | 17 |
2 files changed, 20 insertions, 11 deletions
diff --git a/berkeley/lpq.c b/berkeley/lpq.c index 1c673954..a5285bdd 100644 --- a/berkeley/lpq.c +++ b/berkeley/lpq.c @@ -1,9 +1,9 @@ /* - * "$Id: lpq.c 9744 2011-05-05 23:42:30Z mike $" + * "$Id: lpq.c 10545 2012-07-16 17:16:46Z mike $" * * "lpq" command for CUPS. * - * Copyright 2007-2011 by Apple Inc. + * Copyright 2007-2012 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -371,6 +371,7 @@ show_jobs(const char *command, /* I - Command name */ * attributes-natural-language * job-uri or printer-uri * requested-attributes + * requesting-user-name */ request = ippNewRequest(id ? IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS); @@ -399,6 +400,9 @@ show_jobs(const char *command, /* I - Command name */ "requesting-user-name", NULL, user); ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1); } + else + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requesting-user-name", NULL, cupsUser()); ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", @@ -447,8 +451,8 @@ show_jobs(const char *command, /* I - Command name */ jobpriority = 50; #endif /* __osf__ */ jobstate = IPP_JOB_PENDING; - jobname = "untitled"; - jobuser = NULL; + jobname = "unknown"; + jobuser = "unknown"; jobdest = NULL; jobcopies = 1; @@ -674,5 +678,5 @@ usage(void) /* - * End of "$Id: lpq.c 9744 2011-05-05 23:42:30Z mike $". + * End of "$Id: lpq.c 10545 2012-07-16 17:16:46Z mike $". */ diff --git a/berkeley/lpr.c b/berkeley/lpr.c index 34bb3295..554ea9fa 100644 --- a/berkeley/lpr.c +++ b/berkeley/lpr.c @@ -1,9 +1,9 @@ /* - * "$Id: lpr.c 9636 2011-03-21 22:02:00Z mike $" + * "$Id: lpr.c 10495 2012-05-21 22:40:33Z mike $" * * "lpr" command for CUPS. * - * Copyright 2007-2011 by Apple Inc. + * Copyright 2007-2012 by Apple Inc. * Copyright 1997-2007 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -89,7 +89,7 @@ main(int argc, /* I - Number of command-line arguments */ cupsSetUser(argv[i]); } break; - + case 'H' : /* Connect to host */ if (argv[i][2] != '\0') cupsSetServer(argv[i] + 2); @@ -377,7 +377,6 @@ main(int argc, /* I - Number of command-line arguments */ const char *format; /* Document format */ ssize_t bytes; /* Bytes read */ - if (cupsGetOption("raw", num_options, options)) format = CUPS_FORMAT_RAW; else if ((format = cupsGetOption("document-format", num_options, @@ -395,11 +394,17 @@ main(int argc, /* I - Number of command-line arguments */ { _cupsLangPrintf(stderr, _("%s: Error - unable to queue from stdin - %s."), argv[0], httpStatus(status)); + cupsFinishDocument(CUPS_HTTP_DEFAULT, printer); + cupsCancelJob2(CUPS_HTTP_DEFAULT, printer, job_id, 0); return (1); } if (cupsFinishDocument(CUPS_HTTP_DEFAULT, printer) != IPP_OK) - job_id = 0; + { + _cupsLangPrintf(stderr, "%s: %s", argv[0], cupsLastErrorString()); + cupsCancelJob2(CUPS_HTTP_DEFAULT, printer, job_id, 0); + return (1); + } } if (job_id < 1) @@ -413,5 +418,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id: lpr.c 9636 2011-03-21 22:02:00Z mike $". + * End of "$Id: lpr.c 10495 2012-05-21 22:40:33Z mike $". */ |