]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
Refresh of sendfile
authorSean Hefty <sean.hefty@intel.com>
Tue, 14 Aug 2012 19:27:02 +0000 (12:27 -0700)
committerSean Hefty <sean.hefty@intel.com>
Tue, 14 Aug 2012 19:27:02 +0000 (12:27 -0700)
src/preload.c

index 9b71c77e8dda8143129356a9c2ca1c0c4c11499a..c6cf1761d6efb8233b3ac14f043aa337bda36c0d 100644 (file)
@@ -39,6 +39,7 @@
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
+#include <sys/sendfile.h>
 #include <stdarg.h>
 #include <dlfcn.h>
 #include <netdb.h>
@@ -49,7 +50,6 @@
 #include <netinet/tcp.h>
 #include <unistd.h>
 #include <semaphore.h>
-#include <sendfile.h>
 
 #include <rdma/rdma_cma.h>
 #include <rdma/rdma_verbs.h>
@@ -1027,9 +1027,9 @@ ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count)
        if (file_addr == (void *) -1)
                return -1;
 
-       len = rsend(fd, file_addr, count);
-       if ((len > 0) && offset)
-               lseek(in_fd, len, SEEK_CUR);
+       ret = rwrite(fd, file_addr, count);
+       if ((ret > 0) && offset)
+               lseek(in_fd, ret, SEEK_CUR);
        munmap(file_addr, count);
        return ret;
 }