apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1667916 - /apr/apr/trunk/network_io/unix/sockets.c
Date Fri, 20 Mar 2015 01:09:21 GMT
Author: ylavic
Date: Fri Mar 20 01:09:21 2015
New Revision: 1667916

URL: http://svn.apache.org/r1667916
Log:
Follow up to r1666341: fix missing apr_socket_create() and apr_socket_accept() cases.

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

Modified: apr/apr/trunk/network_io/unix/sockets.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sockets.c?rev=1667916&r1=1667915&r2=1667916&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/sockets.c (original)
+++ apr/apr/trunk/network_io/unix/sockets.c Fri Mar 20 01:09:21 2015
@@ -175,18 +175,21 @@ apr_status_t apr_socket_create(apr_socke
 #ifndef HAVE_SOCK_CLOEXEC
     {
         int flags;
+        apr_status_t rv;
 
         if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) {
+            rv = errno;
             close((*new)->socketdes);
             (*new)->socketdes = -1;
-            return errno;
+            return rv;
         }
 
         flags |= FD_CLOEXEC;
         if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) {
+            rv = errno;
             close((*new)->socketdes);
             (*new)->socketdes = -1;
-            return errno;
+            return rv;
         }
     }
 #endif
@@ -357,18 +360,21 @@ apr_status_t apr_socket_accept(apr_socke
 #ifndef HAVE_ACCEPT4
     {
         int flags;
+        apr_status_t rv;
 
         if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) {
+            rv = errno;
             close((*new)->socketdes);
             (*new)->socketdes = -1;
-            return errno;
+            return rv;
         }
 
         flags |= FD_CLOEXEC;
         if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) {
+            rv = errno;
             close((*new)->socketdes);
             (*new)->socketdes = -1;
-            return errno;
+            return rv;
         }
     }
 #endif



Mime
View raw message