From: Frank Lahm Date: Fri, 25 Nov 2011 16:42:55 +0000 (+0100) Subject: Fix for Solaris sendfile X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=0fe0c9fc53956b6f4d336824c2ee8ee44b657948 Fix for Solaris sendfile --- 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.