From: Eric Wong Date: Mon, 27 Jun 2016 03:56:35 +0000 (+0000) Subject: xread: retry after poll on EAGAIN/EWOULDBLOCK X-Git-Tag: v2.9.3~48^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c22f6202052ca84c68df4fbb16e42c826d429558;p=thirdparty%2Fgit.git xread: retry after poll on EAGAIN/EWOULDBLOCK We should continue to loop after EAGAIN/EWOULDBLOCK as the intent of xread is to try until there is available data, EOF, or an unrecoverable error. Fixes: 1079c4be0b720 ("xread: poll on non blocking fds") Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- diff --git a/wrapper.c b/wrapper.c index 1770efac8e..9b20eb9351 100644 --- a/wrapper.c +++ b/wrapper.c @@ -252,6 +252,7 @@ ssize_t xread(int fd, void *buf, size_t len) * call to read(2). */ poll(&pfd, 1, -1); + continue; } } return nr;