Commits

David Krentzlin committed 1ab5701

fixed offset bug for solaris

Comments (0)

Files changed (1)

strategies/sendfile.solaris.scm

     "fvec.sfv_flag = 0;"
     "fvec.sfv_len = to_send;"
     "fvec.sfv_off = (off_t)offset;"
-    "if(sendfilev(dst,&fvec,1,&written) == -1){"
-    "  C_return(errno == EAGAIN ? -2 : -1);"
+    "if(sendfilev(dst,&fvec,1,&written) < 0){"
+    "  if(errno == EAGAIN){"
+    "    C_return(written == 0 ? -2 : (double)(offset + written));"
+    "  }else{"
+    "    C_return(-1);"
+    "  }"
     "}"
     "C_return((double)(offset + written));"