summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrooneg <rooneg@13f79535-47bb-0310-9956-ffa450edef68>2005-11-23 04:02:34 +0000
committerrooneg <rooneg@13f79535-47bb-0310-9956-ffa450edef68>2005-11-23 04:02:34 +0000
commit80f505386da3bd0abf131614e5e1b85567cea05d (patch)
treef85631bd780712c149acdde42744b1ee1a9d642d
parentc9ace757b8273df872ec2f1563291bfa755e2561 (diff)
downloadlibapr-80f505386da3bd0abf131614e5e1b85567cea05d.tar.gz
Fix a warning when building on FreeBSD due to an error in the arguments
passed to sysctlbyname. The fifth argument is a size_t, not a pointer, so using NULL is incorrect. This change is being committed directly to the 0.9.x branch because the version of this code in trunk no longer uses sysctlbyname. * network_io/unix/sendrecv.c (include_hdrs_in_length): Correct 5 argument to sysctlbyname. * CHANGES: Note change. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/0.9.x@348360 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES3
-rw-r--r--network_io/unix/sendrecv.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 375e9171b..372ac496f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
Changes with APR 0.9.8-dev
-
+ *) Fix warning when compiling on FreeBSD by correcting the type of
+ the final argument passed to sysctlbyname. [Garrett Rooney]
Changes with APR 0.9.7
diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
index 3cd07629a..ac01cad33 100644
--- a/network_io/unix/sendrecv.c
+++ b/network_io/unix/sendrecv.c
@@ -406,7 +406,7 @@ static int include_hdrs_in_length(void)
kernel_version = 0; /* silence compiler warning */
kernel_version_size = sizeof(kernel_version);
if (sysctlbyname("kern.osreldate", &kernel_version,
- &kernel_version_size, NULL, NULL) == 0 &&
+ &kernel_version_size, NULL, 0) == 0 &&
kernel_version < KERNEL_WITH_SENDFILE_LENGTH_FIX) {
api = OLD;
return 1;