The following commit has been merged in the master branch: commit 9238c9ad07dd1bd6c812d6af2167291324240f6d Author: Sven Eckelmann sven.eckelmann@gmx.de Date: Thu Nov 4 14:03:43 2010 +0100
batctl: Re-add ping interval after each loop
The option -i for ping had no visible effect. We can simply change it back to the old behaviour from battool times.
Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de Signed-off-by: Marek Lindner lindner_marek@yahoo.de
diff --git a/ping.c b/ping.c index 1ed8fac..ef5d2af 100644 --- a/ping.c +++ b/ping.c @@ -74,7 +74,7 @@ int ping(char *mesh_iface, int argc, char **argv) ssize_t read_len; fd_set read_socket; int ret = EXIT_FAILURE, ping_fd = 0, res, optchar, found_args = 1; - int loop_count = -1, loop_interval = 1, timeout = 1, rr = 0, i; + int loop_count = -1, loop_interval = 0, timeout = 1, rr = 0, i; unsigned int seq_counter = 0, packets_out = 0, packets_in = 0, packets_loss; char *dst_string, *mac_string, *rr_string; double time_delta; @@ -292,9 +292,10 @@ int ping(char *mesh_iface, int argc, char **argv) }
sleep: - if ((tv.tv_sec != 0) || (tv.tv_usec != 0)) + if (loop_interval > 0) + sleep(loop_interval); + else if ((tv.tv_sec != 0) || (tv.tv_usec != 0)) select(0, NULL, NULL, NULL, &tv); - }
if (packets_out == 0)