aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorsethdelliott <devnull@localhost>2010-06-24 22:02:24 +0000
committersethdelliott <devnull@localhost>2010-06-24 22:02:24 +0000
commit29e3ec74c3a7554bcc3100ac96198374f33cfd97 (patch)
treef1350a34023e1be00890fc6f2adafc83e018f3c4 /src/main.c
parent59aaeda792db7291ed1b4417ba2450b95db84c0f (diff)
downloadiperf3-29e3ec74c3a7554bcc3100ac96198374f33cfd97.tar.gz
Fixed a bug that caused getopt not to work properly when command line arguments are given to the server.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index b6198eb..a6cb899 100644
--- a/src/main.c
+++ b/src/main.c
@@ -229,6 +229,11 @@ main(int argc, char **argv)
}
}
+ /* For subsequent calls to getopt */
+ optreset = 1;
+ optind = 0;
+
+
/* exit until this is done.... */
if (test->protocol == Pudp) {
printf("UDP mode not yet supported. Exiting. \n");
@@ -252,18 +257,9 @@ main(int argc, char **argv)
int
iperf_run(struct iperf_test * test)
{
-
- test->default_settings->state = TEST_RUNNING;
-
switch (test->role) {
case 's':
-// The following lines are commented out until I fix the bind issue with porting
-// while (1) {
- iperf_run_server(test);
-// test->streams = NULL;
-// sleep(1);
-// }
- return 0;
+ return iperf_run_server(test);
case 'c':
return iperf_run_client(test);
default: