[gtk+] Let GTK+ handle SIGPIPE signal itself when printing with lpr



commit f6ed1487bd2c5c2315a07ff2f9f4426102524743
Author: Marek Kasik <mkasik redhat com>
Date:   Wed Sep 16 09:59:56 2009 +0200

    Let GTK+ handle SIGPIPE signal itself when printing with lpr
    
    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 |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/modules/printbackends/lpr/gtkprintbackendlpr.c b/modules/printbackends/lpr/gtkprintbackendlpr.c
index bc9c77f..eeaaa99 100644
--- a/modules/printbackends/lpr/gtkprintbackendlpr.c
+++ b/modules/printbackends/lpr/gtkprintbackendlpr.c
@@ -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, 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]