From patchwork Sat Oct 30 15:00:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 445 Return-Path: Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.22]) by open-mesh.org (Postfix) with SMTP id 46E0D154539 for ; Sat, 30 Oct 2010 16:59:45 +0200 (CEST) Received: (qmail invoked by alias); 30 Oct 2010 14:59:44 -0000 Received: from unknown (EHLO sven-desktop.lazhur.ath.cx) [89.246.213.145] by mail.gmx.net (mp070) with SMTP; 30 Oct 2010 16:59:44 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX18g3C87P6AgwJgYJtAYDZnM4w9QJlnmIA4aKg6JHS HRb1+EbA4vZqFq From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 30 Oct 2010 17:00:56 +0200 Message-Id: <1288450858-14753-4-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1288450858-14753-1-git-send-email-sven.eckelmann@gmx.de> References: <1288450858-14753-1-git-send-email-sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 Subject: [B.A.T.M.A.N.] [PATCH 4/6] batctl: Initialise timeout before usage in error case X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 14:59:46 -0000 Signed-off-by: Sven Eckelmann --- 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(-) diff --git a/batctl/ping.c b/batctl/ping.c index 288bd01..1ed8fac 100644 --- a/batctl/ping.c +++ b/batctl/ping.c @@ -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);