apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@apache.org
Subject cvs commit: apr/network_io/unix sockets.c
Date Thu, 08 Nov 2001 00:30:50 GMT
dreid       01/11/07 16:30:50

  Modified:    network_io/unix sockets.c
  Log:
  Pre-BONE BeOS doesn't have SO_ERROR so only call the code if we have SO_ERROR.
  
  Submitted by:	Brad Froehle <epEnochRoot@yahoo.com>
  Reviewed by:	David Reid <dreid@apache.org>
  
  Revision  Changes    Path
  1.88      +14 -9     apr/network_io/unix/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockets.c,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- sockets.c	2001/08/08 05:48:58	1.87
  +++ sockets.c	2001/11/08 00:30:50	1.88
  @@ -261,7 +261,7 @@
   
   apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
   {
  -    int rc;
  +    int rc;        
   
       do {
           rc = connect(sock->socketdes,
  @@ -273,19 +273,24 @@
        * socket; if called again, we can see EALREADY
        */
       if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && sock->timeout
!= 0) {
  -        int 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, (char *)&error,
&len)) < 0) {
  -            return errno;
           }
  -        if (error) {
  -            return error;
  +
  +#ifdef SO_ERROR
  +        {
  +            int error;
  +            apr_socklen_t len = sizeof(error);
  +            if ((rc = getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, 
  +                                 (char *)&error, &len)) < 0) {
  +                return errno;
  +            }
  +            if (error) {
  +                return error;
  +            }
           }
  +#endif /* SO_ERROR */
       }
   
       if (rc == -1) {
  
  
  

Mime
View raw message