]> Pileus Git - ~andy/gtk/commitdiff
Let GTK+ handle SIGPIPE signal itself when printing with lpr
authorMarek Kasik <mkasik@redhat.com>
Wed, 16 Sep 2009 07:59:56 +0000 (09:59 +0200)
committerMarek Kasik <mkasik@redhat.com>
Wed, 16 Sep 2009 07:59:56 +0000 (09:59 +0200)
When a SIGPIPE signal is raised during printing with lpr,
application should not be killed by the signal but a standard
error-workflow should be performed (bug #503776).

modules/printbackends/lpr/gtkprintbackendlpr.c

index bc9c77fbed7df17f254f3611a27f8a5f4a466d89..eeaaa994ecd293369983f29ad925b8b9b84704e8 100644 (file)
@@ -278,7 +278,9 @@ lpr_write (GIOChannel   *source,
     {
       gsize bytes_written;
 
-      g_io_channel_write_chars (ps->in, 
+      signal (SIGPIPE, SIG_IGN);
+
+      g_io_channel_write_chars (ps->in,
                                 buf, 
                                bytes_read, 
                                &bytes_written,