info: fix send result error check in write_data
authorFerry Huberts <ferry.huberts@pelagic.nl>
Sat, 20 Feb 2016 20:48:54 +0000 (21:48 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Sun, 21 Feb 2016 12:23:39 +0000 (13:23 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/info/olsrd_info.c

index b1a0afb..90a310d 100644 (file)
@@ -167,7 +167,7 @@ static void write_data(void *foo __attribute__ ((unused))) {
       outbuffer.written[i] += result;
     }
 
-    if ((result <= 0) || (outbuffer.written[i] >= outbuffer.size[i])) {
+    if ((result < 0) || (outbuffer.written[i] >= outbuffer.size[i])) {
       /* close this socket and cleanup*/
       close(outbuffer.socket[i]);
       outbuffer.socket[i] = -1;