apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: apr/network_io/unix sockets.c
Date Wed, 08 Aug 2001 05:48:58 GMT
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) {
  
  
  

Mime
View raw message