- "stopping: child terminated with signal %d\n",
- p[sizeof(int) - 1] );
- exit( p[sizeof(int) - 1] );
- } else if ( p[sizeof(int) - 2] != 0 ) {
+ "stopping: child terminated with signal %d%s\n",
+ (int) WTERMSIG(status),
+#ifdef WCOREDUMP
+ WCOREDUMP(status) ? ", core dumped" : ""
+#else
+ ""
+#endif
+ );
+ exit( WEXITSTATUS(status) );
+
+ } else if ( WEXITSTATUS(status) != 0 ) {