Do not allow -r > -t

This commit is contained in:
Nora Shoemaker 2015-07-23 10:37:51 -07:00
parent a04c67bcd6
commit 584f5f3734
1 changed files with 4 additions and 3 deletions

View File

@ -1326,9 +1326,10 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
if (config.rate != 0 && config.nthreads != 1) {
std::cerr << "-r, -t: warning: the -t option will be ignored when the -r "
<< "option is in use." << std::endl;
if (config.is_rate_mode() && config.rate < (ssize_t)config.nthreads) {
std::cerr << "-r, -t: the connection rate must be greater than or equal "
<< "to the number of threads." << std::endl;
exit(EXIT_FAILURE);
}
if (!datafile.empty()) {