iperf: accept -t 0, meaning forever

This commit is contained in:
YAMAMOTO Takashi 2021-06-10 13:34:46 +09:00 committed by Xiang Xiao
parent d2b7d79f1d
commit b9ad64627d
2 changed files with 2 additions and 2 deletions

View File

@ -264,7 +264,7 @@ static void iperf_report_task(void *arg)
now_len,
(((double)(now_len - last_len) * 8) /
ts_diff(&now, &last) / 1e6));
if (ts_diff(&now, &start) >= time)
if (time != 0 && ts_diff(&now, &start) >= time)
{
break;
}

View File

@ -209,7 +209,7 @@ int main(int argc, FAR char *argv[])
else
{
cfg.time = iperf_args.time->ival[0];
if (cfg.time <= cfg.interval)
if (cfg.time != 0 && cfg.time <= cfg.interval)
{
cfg.time = cfg.interval;
}