]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lib: handle read failure in sync case
authorVincent Bernat <vincent@bernat.im>
Sun, 31 Aug 2014 19:53:54 +0000 (21:53 +0200)
committerVincent Bernat <vincent@bernat.im>
Sun, 31 Aug 2014 19:53:54 +0000 (21:53 +0200)
This amends the previous commit with a more concise condition.

src/lib/connection.c

index 8d34e961ec7f9aa719492770123ee0274e7d73b3..5aa4c5104247958e39ddfaf674c9a5c11b6656a7 100644 (file)
@@ -85,7 +85,7 @@ sync_recv(lldpctl_conn_t *lldpctl,
                }
                remain -= nb;
                offset += nb;
-       } while (remain > 0 && (nb > 0 || nb == -1));
+       } while (remain > 0 && nb != 0);
        return offset;
 }