--- sio_test.c 2003/02/11 10:54:07 1.18
+++ sio_test.c 2003/06/30 10:36:52 1.19
@@ -153,9 +153,17 @@
(*client)(_t, pd[0], wcount);
close(pd[0]);
waitpid(child, &status, 0);
- if (status != 0) {
- ts_test_fail(TS_CTX, "child returned status %08lx\n",
- status);
+ if (WIFEXITED(status) && WEXITSTATUS(status) != 0) {
+ ts_test_fail(TS_CTX, "child terminated through exit with return code %d\n",
+ WEXITSTATUS(status));
+ }
+ else if (WIFSIGNALED(status)) {
+ ts_test_fail(TS_CTX, "child terminated through signal %d%s\n",
+ WTERMSIG(status), WCOREDUMP(status) ? " (core dump written)" : "");
+ }
+ else if (WIFSTOPPED(status)) {
+ ts_test_fail(TS_CTX, "child stopped through signal %d%s\n",
+ WSTOPSIG(status));
}
}
}
@@ -1137,9 +1145,17 @@
test_sio_sa_read(_t, sa_client, wcount);
rc = sa_shutdown(sa_server, "r");
waitpid(child, &status, 0);
- if (status != 0) {
- ts_test_fail(TS_CTX, "child returned status %08lx\n",
- status);
+ if (WIFEXITED(status) && WEXITSTATUS(status) != 0) {
+ ts_test_fail(TS_CTX, "child terminated through exit with return code %d\n",
+ WEXITSTATUS(status));
+ }
+ else if (WIFSIGNALED(status)) {
+ ts_test_fail(TS_CTX, "child terminated through signal %d%s\n",
+ WTERMSIG(status), WCOREDUMP(status) ? " (core dump written)" : "");
+ }
+ else if (WIFSTOPPED(status)) {
+ ts_test_fail(TS_CTX, "child stopped through signal %d%s\n",
+ WSTOPSIG(status));
}
}
|