From: Vincent Bernat Date: Sun, 31 Aug 2014 19:53:17 +0000 (+0200) Subject: lib: really correctly handle read failure X-Git-Tag: 0.7.11~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e1556c13cceba704f20292a3945ef4304aba879e;p=thirdparty%2Flldpd.git lib: really correctly handle read failure --- diff --git a/src/lib/connection.c b/src/lib/connection.c index ee6e92ee..8d34e961 100644 --- a/src/lib/connection.c +++ b/src/lib/connection.c @@ -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; }