[Olsr-dev] [PATCH v1 078/115] info: write_data: do not consider an invalid socket for send

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


From: Ferry Huberts <(spam-protected)>

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

diff --git a/lib/info/olsrd_info.c b/lib/info/olsrd_info.c
index b1bf2ae..23d3d31 100644
--- a/lib/info/olsrd_info.c
+++ b/lib/info/olsrd_info.c
@@ -181,6 +181,10 @@ static void write_data(void *foo __attribute__ ((unused))) {
   }
 
   for (i = 0; i < outbuffer.count; i++) {
+    if (outbuffer.socket[i] < 0) {
+      continue;
+    }
+
     if (FD_ISSET(outbuffer.socket[i], &set)) {
       result = send(outbuffer.socket[i], outbuffer.buffer[i] + outbuffer.written[i], outbuffer.size[i] - outbuffer.written[i], 0);
       if (result > 0) {
-- 
2.5.0




More information about the Olsr-dev mailing list