From 12e49a748c26697fb6f697512babb949a6c2931f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 14 Dec 2010 17:35:29 -0800 Subject: Protect the onefs sendfile from EAGAIN/EWOULDBLOCK. Autobuild-User: Jeremy Allison Autobuild-Date: Wed Dec 15 03:26:43 CET 2010 on sn-devel-104 --- source3/modules/onefs_system.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/modules/onefs_system.c b/source3/modules/onefs_system.c index 33bec2658b..94b5da2a9e 100644 --- a/source3/modules/onefs_system.c +++ b/source3/modules/onefs_system.c @@ -269,7 +269,11 @@ static ssize_t onefs_sys_do_sendfile(int tofd, int fromfd, do { ret = sendfile(fromfd, tofd, offset, total, &hdr, &nwritten, flags); - } while (ret == -1 && errno == EINTR); +#if defined(EWOULDBLOCK) + } while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)); +#else + } while (ret == -1 && (errno == EINTR || errno == EAGAIN)); +#endif /* On error we're done. */ if (ret == -1) { -- cgit