[Olsr-dev] [PATCH v1 074/115] info: write_data: exit early if there is nothing to send

Ferry Huberts (spam-protected)
Wed Dec 2 21:28:47 CET 2015


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 lib/info/olsrd_info.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/info/olsrd_info.c b/lib/info/olsrd_info.c
index 6d1ed6b..4866aa7 100644
--- a/lib/info/olsrd_info.c
+++ b/lib/info/olsrd_info.c
@@ -151,6 +151,11 @@ static void write_data(void *foo __attribute__ ((unused))) {
   int result, i, j, max;
   struct timeval tv;
 
+  if (outbuffer.count <= 0) {
+    /* exit early if there is nothing to send */
+    return;
+  }
+
   FD_ZERO(&set);
   max = 0;
   for (i = 0; i < outbuffer.count; i++) {
-- 
2.5.0




More information about the Olsr-dev mailing list