vcl: fix ldp recv return on error 14/26114/2
authorFlorin Coras <fcoras@cisco.com>
Tue, 24 Mar 2020 15:24:29 +0000 (15:24 +0000)
committerDave Barach <openvpp@barachs.net>
Tue, 24 Mar 2020 18:32:26 +0000 (18:32 +0000)
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0875705d3a0c95f2781b0595ef27a30486438aae

src/vcl/ldp.c

index d6e81d6..0dbc6a5 100644 (file)
@@ -1502,7 +1502,10 @@ recv (int fd, void *buf, size_t n, int flags)
     {
       size = vls_recvfrom (vlsh, buf, n, flags, NULL);
       if (size < 0)
-       errno = -size;
+       {
+         errno = -size;
+         size = -1;
+       }
     }
   else
     {