diff options
Diffstat (limited to 'berkeley/lpr.c')
-rw-r--r-- | berkeley/lpr.c | 17 |
1 files changed, 11 insertions, 6 deletions
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 $". */ |