OSSP CVS Repository

ossp - Difference in ossp-pkg/sio/sio_test.c versions 1.18 and 1.19
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/sio/sio_test.c 1.18 -> 1.19

--- 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));
         }
     }
 

CVSTrac 2.0.1