diff options
author | Bruce A. Mah <bmah@es.net> | 2015-11-18 09:40:24 -0800 |
---|---|---|
committer | Bruce A. Mah <bmah@es.net> | 2015-11-18 09:40:24 -0800 |
commit | 956d115851755390bb59ad93a6d501be444b9f73 (patch) | |
tree | 64c1adfb86973f353bdaa8a9b223a0fc5bbb7f94 /src/main.c | |
parent | 44485b5b88089065ba03eadc0b9fe1907d01e976 (diff) | |
download | iperf3-956d115851755390bb59ad93a6d501be444b9f73.tar.gz |
Improve command error handling.
Exit with non-zero exit code if server mode has too many errors.
Properly detect complain about non-numeric arguments to -A, -L, and -S.
Implement range checks for argument to -S.
Fixes #316.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ /* - * iperf, Copyright (c) 2014, The Regents of the University of + * iperf, Copyright (c) 2014, 2015, The Regents of the University of * California, through Lawrence Berkeley National Laboratory (subject * to receipt of any required approvals from the U.S. Dept. of * Energy). All rights reserved. @@ -153,10 +153,9 @@ run(struct iperf_test *test) for (;;) { if (iperf_run_server(test) < 0) { iperf_err(test, "error - %s", iperf_strerror(i_errno)); - fprintf(stderr, "\n"); ++consecutive_errors; if (consecutive_errors >= 5) { - fprintf(stderr, "too many errors, exiting\n"); + iperf_errexit(test, "too many errors, exiting"); break; } } else |