Commits

David Krentzlin committed 7f3afbc

fixed the fix ;)

  • Participants
  • Parent commits 902b048

Comments (0)

Files changed (1)

strategies/sendfile.linux.scm

        "off_t curoffset = (off_t)offset;"
        "if((posix_fadvise(src,0,0,POSIX_FADV_SEQUENTIAL) < 0) && errno != ENOSYS){ C_return(-1); }"
        "if(sendfile(dst,src,&curoffset,to_send) < 0){"
-       "   if(errno == EAGAIN || errno == EINTR){ C_return(-2); }"
-       "   C_return(-1);"
+       "   if(errno == EAGAIN || errno == EINTR){ "
+       "     C_return(curoffset == 0 ? -2 : (double)(curoffset)); "
+       "   }else{"
+       "     C_return(-1);"
+       "   }"
        "}"
        " if(((off_t)offset & ~(READ_AHEAD - 1)) != (((off_t)offset + res) & ~(READ_AHEAD - 1))){"
        "  if(posix_fadvise(src,((off_t)offset + res) & ~(READ_AHEAD - 1),READ_AHEAD,POSIX_FADV_NOREUSE) < 0){"
        "off_t curoffset = (off_t)offset;"
        "if(sendfile(dst,src,&curoffset,to_send) < 0){"
        "   if(errno == EAGAIN || errno == EINTR){    "
-       "     C_return(curoffset == 0 ? -2 (double)(curoffset)); "
+       "     C_return(curoffset == 0 ? -2 : (double)(curoffset)); "
        "   }else{ "
        "     C_return(-1);"
        "   }"