From 36c2a2eee7216ad63fef39808d293d1dd9d16eb1 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Wed, 7 May 2008 15:46:32 +0000 Subject: [PATCH] - Avoid busy-looping when the CUPS backend stops (bug #445555). --- foomatic-sigpipe.patch | 54 ++++++++++++++++++++++++++++++++++++++++++ foomatic.spec | 5 ++++ 2 files changed, 59 insertions(+) create mode 100644 foomatic-sigpipe.patch diff --git a/foomatic-sigpipe.patch b/foomatic-sigpipe.patch new file mode 100644 index 0000000..8c13f1b --- /dev/null +++ b/foomatic-sigpipe.patch @@ -0,0 +1,54 @@ +diff -up foomatic-filters-3.0-20080211/foomatic-rip.in.sigpipe foomatic-filters-3.0-20080211/foomatic-rip.in +--- foomatic-filters-3.0-20080211/foomatic-rip.in.sigpipe 2008-05-07 16:40:10.000000000 +0100 ++++ foomatic-filters-3.0-20080211/foomatic-rip.in 2008-05-07 16:45:16.000000000 +0100 +@@ -3599,6 +3599,7 @@ sub getrendererhandle { + + close KID3; + ++ $SIG{PIPE} = 'DEFAULT'; + pipe KID4_IN, KID4; + KID4->autoflush(1); + $kid4 = fork(); +@@ -3779,11 +3780,15 @@ sub getrendererhandle { + # When arrived here the renderer command line was successful + # So exit with zero exit value here and inform the main process + close KID_MESSAGE; +- print KID_MESSAGE_IN "3 $EXIT_PRINTED\n"; +- close KID_MESSAGE_IN; + # Wait for postpipe/output child + waitpid($kid4, 0); +- print $logh "KID3 finished\n"; ++ if ($? != 0) { ++ print KID_MESSAGE_IN "3 $EXIT_SIGNAL\n"; ++ } else { ++ print KID_MESSAGE_IN "3 $EXIT_PRINTED\n"; ++ } ++ close KID_MESSAGE_IN; ++ print $logh "KID3 finished with $?\n"; + exit $EXIT_PRINTED; + } else { + $kidgeneration += 1; +@@ -4132,6 +4137,7 @@ sub getfileconverterhandle { + # converter + close KID1_IN; + ++ $SIG{PIPE} = 'DEFAULT'; + pipe KID2_IN, KID2; + KID2->autoflush(1); + $kid2 = fork(); +@@ -4603,6 +4609,7 @@ sub getdocgeneratorhandle { + # we are the kid; we generate the documentation page + + close KID0_IN; ++ $SIG{PIPE} = 'DEFAULT'; + + # Kill data on STDIN to satisfy PPR + if (($spooler eq 'ppr_int') || ($spooler eq 'ppr')) { +@@ -6661,6 +6668,7 @@ sub modern_system { + # will be members of this process group and so by killing this + # process group we can kill all subprocesses and so we can + # cleanly cancel print jobs ++ $SIG{PIPE} = 'DEFAULT'; + eval("setpgrp()"); + # Stop catching signals + #use sigtrap qw(die normal-signals error-signals diff --git a/foomatic.spec b/foomatic.spec index 600b30f..4723831 100644 --- a/foomatic.spec +++ b/foomatic.spec @@ -44,6 +44,7 @@ Patch15: foomatic-bad-utf8.patch Patch16: foomatic-ieee1284.patch Patch17: foomatic-clean-up-on-cancel.patch +Patch18: foomatic-sigpipe.patch Url: http://www.linuxprinting.org BuildRequires: perl >= 3:5.8.1 @@ -89,6 +90,7 @@ pushd foomatic-filters-3.0-%{filtersver} %patch1 -p1 -b .libdir %patch5 -p1 -b .fontpath %patch17 -p1 -b .clean-up-on-cancel +%patch18 -p1 -b .sigpipe ./make_configure popd @@ -248,6 +250,9 @@ rm -fr %buildroot $RPM_BUILD_DIR/%{name} %{_var}/cache/foomatic %changelog +* Wed May 7 2008 Tim Waugh +- Avoid busy-looping when the CUPS backend stops (bug #445555). + * Tue Apr 1 2008 Tim Waugh 3.0.2-59 - More foo2zjs printers removed (bug #438319).