-# this is not working right, $r == 0x8b00 when there is a core dump.
-# clearly, we need some platform specific perl magic to take this apart, so look for "core"
-# too.
-# In particular, on Solaris 10 SPARC an alignment problem results in SIGILL,
-# a core dump and $r set to 0x00008a00 ($? == 138 in the shell).
-if($r & 127 || -f "core") {
- my $with = ($r & 128) ? 'with' : 'without';
- if(-f "core") {
- $with = "with";
+ # this is not working right, $r == 0x8b00 when there is a core dump.
+ # clearly, we need some platform specific perl magic to take this apart, so look for "core"
+ # too.
+ # In particular, on Solaris 10 SPARC an alignment problem results in SIGILL,
+ # a core dump and $r set to 0x00008a00 ($? == 138 in the shell).
+ if($r & 127 || -f "core") {
+ my $with = ($r & 128) ? 'with' : 'without';
+ if(-f "core") {
+ $with = "with";
+ }
+ printf " (terminated with signal %u, %s coredump)", ($r & 127), $with;
+ if($linecount == 0) {
+ print "\n";
+ } else {
+ print " with error messages:\n";
+ system "cat $stderrlog";
+ }
+ exit ($r & 128) ? 10 : 20;