GNOME Bugzilla – Bug 390159
printing with BSD lpr does not work properly
Last modified: 2006-12-28 12:25:55 UTC
Please describe the problem: Hi, when I try to print via the GTK+ printing API, printing with LPR does not work as it probably should be. When I select to print with LPR, and hit "Print" in the printing dialog, a lpr process gets spawned, and the printing dialog closes. But the lpr process does not come to an end (probably waiting for more input data on STDIN?) Only after I close the application, the lpr finishes, the printing queue gets filled, and my printer starts printing Steps to reproduce: 1. start gtk-demo 2. double-click "Printing" 3. select "Print to LPR" 4. click on "Print" 5. do a "ps -ax| grep lpr" 6. close gtk-demo Actual results: a lpr process gets spawned after "Print" from the printing dialog was hit. the lpr process stays until gtk-demo gets closed after gtk-demo was closed, the lpr process is gone lpq shows an entry in the queue the printer starts printing Expected results: I expect that the spawned lpr process comes to an end automatically after the document got piped to it and printing starts immediate Does this happen every time? yes Other information: this happens on FreeBSD 6.2-PRERELEASE, gtk 2.10.6, glib-2.12.6
Created attachment 78969 [details] [review] Fix lpr printing This patch should do the trick. It makes sure the underlying stdin pipe for lpr is closed when the channel is unref'd.
2006-12-27 Matthias Clasen <mclasen@redhat.com> * modules/printbackends/lpr/gtkprintbackendlpr.c (gtk_print_backend_lpr_print_stream): Close the io channel on unref. (#390159, Joe Markus Clarke)
I can confirm, that the patch fixes this issue