]> arthur.barton.de Git - netatalk.git/commitdiff
Fix for Solaris sendfile
authorFrank Lahm <franklahm@googlemail.com>
Fri, 25 Nov 2011 16:42:55 +0000 (17:42 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Fri, 25 Nov 2011 16:42:55 +0000 (17:42 +0100)
libatalk/dsi/dsi_stream.c

index 6c8b51e4b620da5e5ceec9197e6f5150d4db6f99..c709f2166fc8972e6a693fabc98fd535aab6663e 100644 (file)
@@ -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.