[4/6] batctl: Initialise timeout before usage in error case
Commit Message
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
This patch is useless if we also add
"batctl: Readd ping interval after each loop"
batctl/ping.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
@@ -180,6 +180,9 @@ int ping(char *mesh_iface, int argc, char **argv)
packet_len, packet_len + 28);
while (!is_aborted) {
+ tv.tv_sec = timeout;
+ tv.tv_usec = 0;
+
if (loop_count == 0)
break;
@@ -195,9 +198,6 @@ int ping(char *mesh_iface, int argc, char **argv)
start_timer();
- tv.tv_sec = timeout;
- tv.tv_usec = 0;
-
FD_ZERO(&read_socket);
FD_SET(ping_fd, &read_socket);