apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r472076 - /apr/apr/trunk/network_io/unix/sendrecv.c
Date Tue, 07 Nov 2006 12:05:51 GMT
Author: jorton
Date: Tue Nov  7 04:05:51 2006
New Revision: 472076

URL: http://svn.apache.org/viewvc?view=rev&rev=472076
Log:
* network_io/unix/sendrecv.c (apr_socket_sendfile) [HAVE_SENDFILEV]:
Prevent EFAULT failures with Solaris sendfilev in LFS builds.

PR: 39463
Submitted by: jorton, Joseph Tam <tam math.ubc.ca>

Modified:
    apr/apr/trunk/network_io/unix/sendrecv.c

Modified: apr/apr/trunk/network_io/unix/sendrecv.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sendrecv.c?view=diff&rev=472076&r1=472075&r2=472076
==============================================================================
--- apr/apr/trunk/network_io/unix/sendrecv.c (original)
+++ apr/apr/trunk/network_io/unix/sendrecv.c Tue Nov  7 04:05:51 2006
@@ -879,7 +879,9 @@
     for (i = 0; i < hdtr->numheaders; i++, curvec++) {
         sfv[curvec].sfv_fd = SFV_FD_SELF;
         sfv[curvec].sfv_flag = 0;
-        sfv[curvec].sfv_off = (apr_off_t)hdtr->headers[i].iov_base;
+        /* Cast to unsigned long to prevent sign extension of the
+         * pointer value for the LFS case; see PR 39463. */
+        sfv[curvec].sfv_off = (unsigned long)hdtr->headers[i].iov_base;
         sfv[curvec].sfv_len = hdtr->headers[i].iov_len;
         requested_len += sfv[curvec].sfv_len;
     }
@@ -903,7 +905,7 @@
     for (i = 0; i < hdtr->numtrailers; i++, curvec++) {
         sfv[curvec].sfv_fd = SFV_FD_SELF;
         sfv[curvec].sfv_flag = 0;
-        sfv[curvec].sfv_off = (apr_off_t)hdtr->trailers[i].iov_base;
+        sfv[curvec].sfv_off = (unsigned long)hdtr->trailers[i].iov_base;
         sfv[curvec].sfv_len = hdtr->trailers[i].iov_len;
         requested_len += sfv[curvec].sfv_len;
     }



Mime
View raw message