Datagram sockets may return 0 and stream sockets can return 0
if the requested number of bytes to read is 0.

Signed-off-by: Kenth Eriksson <kenth.eriks...@infinera.com>
---
 sysdep/unix/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index d1d86e3b..44dd3172 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -1873,7 +1873,7 @@ sk_read(sock *s, int revents)
          s->err_hook(s, 0);
        }
       }
-      else if (!c)
+      else if (!c && (revents & POLLHUP))
        s->err_hook(s, 0);
       else
       {
-- 
2.21.0

Reply via email to