Skip to content

Commit c22f620

Browse files
Eric Wonggitster
authored andcommitted
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: 1079c4b ("xread: poll on non blocking fds") Signed-off-by: Eric Wong <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2a73b3d commit c22f620

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

wrapper.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ ssize_t xread(int fd, void *buf, size_t len)
252252
* call to read(2).
253253
*/
254254
poll(&pfd, 1, -1);
255+
continue;
255256
}
256257
}
257258
return nr;

0 commit comments

Comments
 (0)