]> arthur.barton.de Git - netatalk.git/commitdiff
sendfile on Solaris may return EINTR with bytes written https://issues.apache.org...
authorFrank Lahm <franklahm@googlemail.com>
Fri, 3 Aug 2012 06:01:07 +0000 (08:01 +0200)
committerFrank Lahm <franklahm@gmail.com>
Mon, 13 Aug 2012 12:12:25 +0000 (14:12 +0200)
libatalk/dsi/dsi_stream.c

index ab1339184b48b1394a89415c481f2689ad0d83c9..d301267d330c8805c6852ebbf8ebb5f3d31bdb20 100644 (file)
@@ -338,13 +338,16 @@ ssize_t dsi_stream_read_file(DSI *dsi, int fromfd, off_t offset, const size_t le
     len = sys_sendfile(dsi->socket, fromfd, &pos, length - written);
         
     if (len < 0) {
-      if (errno == EINTR)
-          continue;
       if (errno == EINVAL || errno == ENOSYS) {
           ret = -1;
           goto exit;
       }          
-      if (errno == EAGAIN || errno == EWOULDBLOCK) {
+      if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
+          /*
+           * May return EINTR too, see:
+           * http://wesunsolve.net/bugid/id/6408517
+           * https://issues.apache.org/bugzilla/show_bug.cgi?id=44550
+           */
 #if defined(SOLARIS) || defined(FREEBSD)
           if (pos > offset) {
               /* we actually have sent sth., adjust counters and keep trying */