chiark / gitweb /
update-xfonts-traditional: Generalise SIGPIPE handling in process_filter
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 May 2016 11:37:03 +0000 (12:37 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 May 2016 11:41:29 +0000 (12:41 +0100)
If we didn't want to process this font, tolerate SIGPIPE for all
elements of the pipeline before "self", rather than special-casing
pcf2bdf.

(We end up setting {SigOK}{13} again for gunzip, which is fine.)

Now process_filter has no knowledge of particular pipeline stages.

update-xfonts-traditional

index 8dccad424924f88c36c012ceab5cc6a69a72cc14..01ae14584e645a15533bace6d52ce8c20024c8be 100755 (executable)
@@ -241,16 +241,23 @@ sub process_filter ($$$$$$$$) {
        # for some other reason then sending it a KILL now won't
        # affect its exit status.)  We kill the output filters (before
        # we close the output pipe) so we don't produce messages from
-       # our output filters about corrupted data.
+       # our output filters about corrupted data.  And we tolerate
+       # SIGPIPE in all the input filters.
        flush $uswrite or die $!;
 
+       my $filterkind = 'input';
        foreach my $ch (@children) {
            if ($ch->{Stage} ne 'self') {
                kill 9, $ch->{Pid} or die "$ch->{Pid} $ch->{Exe} $!";
                $ch->{SigOK}{9} = 1;
+           } else {
+               $filterkind = 'output';
+               next;
+           }
+           if ($filterkind eq 'input') {
+               $ch->{SigOK}{13} = 1;
            }
        }
-       $ch{'pcf2bdf'}{SigOK}{13} = 1;
        # ... we might not have read all the output from pcf2bdf, which is OK
     }