Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 80342 invoked by uid 500); 8 Aug 2001 05:50:45 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 80313 invoked from network); 8 Aug 2001 05:50:44 -0000 Date: 8 Aug 2001 05:48:58 -0000 Message-ID: <20010808054858.43601.qmail@icarus.apache.org> From: jwoolley@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/network_io/unix sockets.c X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N jwoolley 01/08/07 22:48:58 Modified: network_io/unix sockets.c Log: Clean up two warnings: Warning #1 may or may not have ever existed (my mind is a blur), but this change seems to be the most sensible way to go anyhow. The len parameter to getsockopt() seems to most want to be an apr_socklen_t in order to get along with all platforms. Warning #2 I definitely saw on Solaris 2.6, which was that parm 4 to getsockopt() was an incompatible pointer type. That's funky, because we were passing in an int* to a function that generally expects a void*. Right? Wrong, not in this case. Solaris 2.6 ifndef _XPG4_2 (and possibly Win32 as well according to msdn.microsoft.com) expect a char*! That's wacky. Anyway, casting the int* to a char* makes these platforms happy (ugly though it is), and the sane platforms that just take a void* could care less either way. Revision Changes Path 1.87 +2 -2 apr/network_io/unix/sockets.c Index: sockets.c =================================================================== RCS file: /home/cvs/apr/network_io/unix/sockets.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -u -r1.86 -r1.87 --- sockets.c 2001/08/08 00:30:17 1.86 +++ sockets.c 2001/08/08 05:48:58 1.87 @@ -274,13 +274,13 @@ */ if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && sock->timeout != 0) { int error; - apr_size_t len = sizeof(error); + apr_socklen_t len = sizeof(error); rc = apr_wait_for_io_or_timeout(sock, 0); if (rc != APR_SUCCESS) { return rc; } - if ((rc = getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, &error, &len)) < 0) { + if ((rc = getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, (char *)&error, &len)) < 0) { return errno; } if (error) {