From: Pierangelo Masarati Date: Tue, 28 Mar 2006 11:51:40 +0000 (+0000) Subject: fix previous commit: count to nreqs or maxkids, whatever is larger X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~102 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e5e8a5a5974d88f55b9c7ba5e1b82be3681cbb22;p=openldap fix previous commit: count to nreqs or maxkids, whatever is larger --- diff --git a/tests/progs/slapd-tester.c b/tests/progs/slapd-tester.c index 8f98a8abc5..a430a45277 100644 --- a/tests/progs/slapd-tester.c +++ b/tests/progs/slapd-tester.c @@ -588,8 +588,10 @@ main( int argc, char **argv ) bargs[banum++] = NULL; bargs[banum++] = NULL; +#define DOREQ(n,j) ((n) && ((maxkids > (n)) ? ((j) < maxkids ) : ((j) < (n)))) + for ( j = 0; j < MAXREQS; j++ ) { - if ( snum ) { + if ( DOREQ( snum, j ) ) { int jj = j % snum; sargs[sanum - 2] = sreqs[jj]; @@ -604,7 +606,7 @@ main( int argc, char **argv ) fork_child( scmd, sargs ); } - if ( rnum ) { + if ( DOREQ( rnum, j ) ) { int jj = j % rnum; rargs[ranum - 2] = rreqs[jj]; @@ -618,14 +620,14 @@ main( int argc, char **argv ) fork_child( rcmd, rargs ); } - if ( mnum ) { + if ( DOREQ( mnum, j ) ) { int jj = j % mnum; margs[manum - 2] = mreqs[jj]; fork_child( mcmd, margs ); } - if ( modnum ) { + if ( DOREQ( modnum, j ) ) { int jj = j % modnum; modargs[modanum - 4] = moddn[jj]; @@ -633,14 +635,14 @@ main( int argc, char **argv ) fork_child( modcmd, modargs ); } - if ( anum ) { + if ( DOREQ( anum, j ) ) { int jj = j % anum; aargs[aanum - 2] = afiles[jj]; fork_child( acmd, aargs ); } - if ( bnum ) { + if ( DOREQ( bnum, j ) ) { int jj = j % bnum; bargs[banum - 4] = breqs[jj];