changeset 259:78e95fab9a8b

add some debug checking for process exit status
author Carl Byington <carl@five-ten-sg.com>
date Sat, 16 Apr 2011 10:31:32 -0700
parents 8ad8fd1c5451
children 156cf548c764
files regression/regression-tests.bash src/readpst.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/regression/regression-tests.bash	Sat Apr 16 10:09:28 2011 -0700
+++ b/regression/regression-tests.bash	Sat Apr 16 10:31:32 2011 -0700
@@ -65,7 +65,8 @@
             #$val ../src/readpst $jobs -te -r -D -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
 
             ## normal recursive dump
-            $val ../src/readpst $jobs     -r    -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
+            $val ../src/readpst  -j 10 -Sb -o output$n            $fn >$ba.err 2>&1
+            #$val ../src/readpst $jobs     -r    -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
 
             ## separate mode with filename extensions
             #$val ../src/readpst $jobs     -r -e -D -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
--- a/src/readpst.c	Sat Apr 16 10:09:28 2011 -0700
+++ b/src/readpst.c	Sat Apr 16 10:31:32 2011 -0700
@@ -161,9 +161,16 @@
             pid_t ch = waitpid(child, &status, ((waitall) ? 0 : WNOHANG));
             if (ch == child) {
                 // check termination status
+                //if (WIFEXITED(status)) {
+                //    int ext = WEXITSTATUS(status);
+                //    printf("Process %d exited with status  %d\n", child, ext);
+                //    fflush(stdout);
+                //}
                 if (WIFSIGNALED(status)) {
                     int sig = WTERMSIG(status);
                     DEBUG_INFO(("Process %d terminated with signal %d\n", child, sig));
+                    //printf("Process %d terminated with signal %d\n", child, sig);
+                    //fflush(stdout);
                 }
                 // this has terminated, remove it from the list
                 for (j=i; j<active_children-1; j++) {