mirror of
https://github.com/samba-team/samba.git
synced 2025-08-29 13:49:30 +03:00
s4:torture - prefer the termination "return"s at the end of two unittests
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Mon Nov 29 23:29:23 CET 2010 on sn-devel-104
This commit is contained in:
@ -1340,7 +1340,7 @@ static bool run_iometer(struct torture_context *tctx,
|
||||
for (i=0; i<num_reads; i++) {
|
||||
ssize_t res;
|
||||
if (ops++ > torture_numops) {
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
res = smbcli_read(cli->tree, fnum, buf,
|
||||
random() % filesize, sizeof(buf));
|
||||
@ -1351,7 +1351,7 @@ static bool run_iometer(struct torture_context *tctx,
|
||||
for (i=0; i<num_writes; i++) {
|
||||
ssize_t res;
|
||||
if (ops++ > torture_numops) {
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
res = smbcli_write(cli->tree, fnum, 0, buf,
|
||||
random() % filesize, sizeof(buf));
|
||||
@ -1360,6 +1360,8 @@ static bool run_iometer(struct torture_context *tctx,
|
||||
smbcli_errstr(cli->tree)));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -123,18 +123,23 @@ done:
|
||||
|
||||
static bool children_remain(void)
|
||||
{
|
||||
bool res;
|
||||
|
||||
/* Reap as many children as possible. */
|
||||
for (;;) {
|
||||
pid_t ret = waitpid(-1, NULL, WNOHANG);
|
||||
if (ret == 0) {
|
||||
/* no children ready */
|
||||
return true;
|
||||
res = true;
|
||||
break;
|
||||
}
|
||||
if (ret == -1) {
|
||||
/* no children left. maybe */
|
||||
return errno == ECHILD ? false : true;
|
||||
res = errno != ECHILD;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static double rate_convert_secs(unsigned count,
|
||||
|
Reference in New Issue
Block a user