-if($r & 127) {
- printf " (terminated with signal %u, %s coredump)\n", ($r & 127), ($r & 128) ? 'with' : 'without';
- exit ($r & 128) ? 10 : 20;
+
+# 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.
+if($r & 127 || -f "core") {
+ my $with = ($r & 128) ? 'with' : 'without';
+ if(-f "core") {
+ $with = "with";
+ }
+ printf " (terminated with signal %u, %s coredump)\n", ($r & 127), $with;
+ exit ($r & 128) ? 10 : 20;