From 0fe0c9fc53956b6f4d336824c2ee8ee44b657948 Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Fri, 25 Nov 2011 17:42:55 +0100 Subject: [PATCH] Fix for Solaris sendfile --- libatalk/dsi/dsi_stream.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libatalk/dsi/dsi_stream.c b/libatalk/dsi/dsi_stream.c index 6c8b51e4..c709f216 100644 --- a/libatalk/dsi/dsi_stream.c +++ b/libatalk/dsi/dsi_stream.c @@ -342,6 +342,14 @@ ssize_t dsi_stream_read_file(DSI *dsi, int fromfd, off_t offset, const size_t le goto exit; } if (errno == EAGAIN || errno == EWOULDBLOCK) { +#ifdef SOLARIS + if (pos > offset) { + /* we actually have sent sth., adjust counters and keep trying */ + len = pos - offset; + written += len; + offset = pos; + } +#endif if (dsi_peek(dsi)) { /* can't go back to blocking mode, exit, the next read will return with an error and afpd will die. -- 2.39.2