After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 390159 - printing with BSD lpr does not work properly
printing with BSD lpr does not work properly
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.10.x
Other FreeBSD
: Normal major
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-12-27 22:18 UTC by Oliver Lehmann
Modified: 2006-12-28 12:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix lpr printing (427 bytes, patch)
2006-12-28 02:26 UTC, Joe Marcus Clarke
none Details | Review

Description Oliver Lehmann 2006-12-27 22:18:47 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
Comment 1 Joe Marcus Clarke 2006-12-28 02:26:47 UTC
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.
Comment 2 Matthias Clasen 2006-12-28 04:24:33 UTC
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)

Comment 3 Oliver Lehmann 2006-12-28 12:25:55 UTC
I can confirm, that the patch fixes this issue