~ubuntu-branches/ubuntu/precise/cups/precise

« back to all changes in this revision

Viewing changes to backend/usb-libusb.c

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2011-10-21 06:26:41 UTC
  • Revision ID: james.westby@ubuntu.com-20111021062641-oj14931xjy8cbp20
Tags: 1.5.0-10
* debian/cups.postinst: Allow PPD updater trigger files in
  /usr/share/cups/ppd-updaters/ also be named <driver>.ppd-updater
  and not only simply <driver>. This makes it easier to provide these
  files in the printer driver packages.
* debian/patches/usb-backend-reset-printer-before-printing.patch: When
  using the "usb" CUPS backend, reset the printer before each job as
  otherwise on some printers subsequent jobs will come out as garbage
  (LP: #872483).

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include <usb.h>
33
33
#include <poll.h>
34
34
#include <cups/cups-private.h>
 
35
#include <linux/usbdevice_fs.h>
35
36
 
36
37
 
37
38
/*
119
120
    sleep(5);
120
121
  }
121
122
 
 
123
 /*
 
124
  * Reset printer device ...
 
125
  */
 
126
 
 
127
  if (usb_reset(printer->handle) < 0)
 
128
  {
 
129
    _cupsLangPrintFilter(stderr, "ERROR",
 
130
                         _("Unable to reset printer."));
 
131
  }
 
132
  /* we have to close and reopen the device after the reset, but
 
133
     for reopening it we cannot do a simple "open_device(printer, 1)"
 
134
     as with this some printers, like the HP LaserJet 3390, crash and
 
135
     reboot and the job gets dropped. Therefore we need to reinitialize
 
136
     the connection by calling "find_device(print_cb, uri)" again. */
 
137
  close_device(printer);
 
138
  while ((printer = find_device(print_cb, uri)) == NULL)
 
139
  {
 
140
    _cupsLangPrintFilter(stderr, "INFO",
 
141
                         _("Waiting for printer to become available."));
 
142
    sleep(5);
 
143
  }
122
144
 
123
145
 /*
124
146
  * If we are printing data from a print driver on stdin, ignore SIGTERM