]> git.sur5r.net Git - openldap/commitdiff
tell what child is causing trouble
authorPierangelo Masarati <ando@openldap.org>
Sun, 29 Aug 2010 01:12:28 +0000 (01:12 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 29 Aug 2010 01:12:28 +0000 (01:12 +0000)
tests/progs/slapd-tester.c

index b114ccab8772401c87b39fb565fc1ca5fe57ef26..1e75499568ee1524520b4b2bba0a18b335b7cfc2 100644 (file)
@@ -1124,17 +1124,17 @@ wait4kids( int nkidval )
        int             status;
 
        while ( nkids >= nkidval ) {
-               wait( &status );
+               pid_t pid = wait( &status );
 
                if ( WIFSTOPPED(status) ) {
                        fprintf( stderr,
-                           "stopping: child stopped with signal %d\n",
-                           (int) WSTOPSIG(status) );
+                           "stopping: child PID=%ld stopped with signal %d\n",
+                           (long) pid, (int) WSTOPSIG(status) );
 
                } else if ( WIFSIGNALED(status) ) {
                        fprintf( stderr, 
-                           "stopping: child terminated with signal %d%s\n",
-                           (int) WTERMSIG(status),
+                           "stopping: child PID=%ld terminated with signal %d%s\n",
+                           (long) pid, (int) WTERMSIG(status),
 #ifdef WCOREDUMP
                                WCOREDUMP(status) ? ", core dumped" : ""
 #else
@@ -1145,8 +1145,8 @@ wait4kids( int nkidval )
 
                } else if ( WEXITSTATUS(status) != 0 ) {
                        fprintf( stderr, 
-                           "stopping: child exited with status %d\n",
-                           (int) WEXITSTATUS(status) );
+                           "stopping: child PID=%ld exited with status %d\n",
+                           (long) pid, (int) WEXITSTATUS(status) );
                        exit( WEXITSTATUS(status) );
 
                } else {