When some child processes could not be created, smbtorture would exit
and leave the successfully started child processes running. Add a loop
to kill the existing child processes for this case.
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Feb 2 01:35:27 CET 2012 on sn-devel-104
if (synccount != torture_nprocs) {
printf("FAILED TO START %d CLIENTS (started %d)\n", torture_nprocs, synccount);
+
+ /* cleanup child processes */
+ for (i = 0; i < torture_nprocs; i++) {
+ if (child_status[i]) {
+ kill(child_status[i], SIGTERM);
+ }
+ }
+
*result = false;
return timeval_elapsed(&tv);
}