]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lib: really correctly handle read failure
authorVincent Bernat <vincent@bernat.im>
Sun, 31 Aug 2014 19:53:17 +0000 (21:53 +0200)
committerVincent Bernat <vincent@bernat.im>
Sun, 31 Aug 2014 19:53:17 +0000 (21:53 +0200)
src/lib/connection.c

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