From 36ffe4f467779cd282ed471f3bed8aee8a7c55bd Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 28 Sep 2010 07:40:27 +0200 Subject: [PATCH] selftest: Abort early on SIGPIPE. --- selftest/filter-subunit | 1 + selftest/selftest.pl | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/selftest/filter-subunit b/selftest/filter-subunit index 3ec74c46c7a..872d07fdb11 100755 --- a/selftest/filter-subunit +++ b/selftest/filter-subunit @@ -53,4 +53,5 @@ msg_ops = subunithelper.FilterOps(out, opts.prefix, expected_failures, try: sys.exit(subunithelper.parse_results(msg_ops, statistics, sys.stdin)) except subunithelper.ImmediateFail: + sys.stdout.flush() sys.exit(1) diff --git a/selftest/selftest.pl b/selftest/selftest.pl index 2680b6adcee..33af5e29b71 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -166,6 +166,14 @@ my $prefix = "./st"; my @includes = (); my @excludes = (); +sub pipe_handler { + my $sig = shift @_; + print STDERR "Exiting early because of SIGPIPE.\n"; + exit(1); +} + +$SIG{PIPE} = \&pipe_handler; + sub find_in_list($$) { my ($list, $fullname) = @_;