SOURCES: apr-bug-46425.patch - use fdflags not flags for consistency

arekm arekm at pld-linux.org
Thu Mar 19 00:27:06 CET 2009


Author: arekm                        Date: Wed Mar 18 23:27:06 2009 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use fdflags not flags for consistency

---- Files affected:
SOURCES:
   apr-bug-46425.patch (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: SOURCES/apr-bug-46425.patch
diff -u SOURCES/apr-bug-46425.patch:1.6 SOURCES/apr-bug-46425.patch:1.7
--- SOURCES/apr-bug-46425.patch:1.6	Thu Mar 19 00:20:18 2009
+++ SOURCES/apr-bug-46425.patch	Thu Mar 19 00:27:00 2009
@@ -6,7 +6,7 @@
                               int which_dup)
  {
 -    int rv;
-+    int rv, flags = 0;
++    int rv, fdflags;
      
      if (which_dup == 2) {
          if ((*new_file) == NULL) {
@@ -15,11 +15,11 @@
          }
          rv = dup2(old_file->filedes, (*new_file)->filedes);
 +        if (!(old_file->flags & APR_INHERIT)) {
-+            flags = fcntl((*new_file)->filedes, F_GETFD);
-+            if (flags == -1)
++            fdflags = fcntl((*new_file)->filedes, F_GETFD);
++            if (fdflags == -1)
 +                return errno;
-+            flags |= FD_CLOEXEC;
-+            if (fcntl((*new_file)->filedes, F_SETFD, flags) == -1)
++            fdflags |= FD_CLOEXEC;
++            if (fcntl((*new_file)->filedes, F_SETFD, fdflags) == -1)
 +                return errno;
 +        }
      } else {
@@ -79,11 +79,11 @@
      if (the##name->flag & APR_FILE_NOCLEANUP)                       \
          return APR_EINVAL;                                          \
      if (!(the##name->flag & APR_INHERIT)) {                         \
-+        int flags = fcntl(the##name->name##des, F_GETFD);           \
-+        if (flags == -1)                                            \
++        int fdflags = fcntl(the##name->name##des, F_GETFD);           \
++        if (fdflags == -1)                                            \
 +            return errno;                                           \
-+        flags &= ~(FD_CLOEXEC);                                     \
-+        if (fcntl(the##name->name##des, F_SETFD, flags) == -1)      \
++        fdflags &= ~(FD_CLOEXEC);                                     \
++        if (fcntl(the##name->name##des, F_SETFD, fdflags) == -1)      \
 +            return errno;                                           \
          the##name->flag |= APR_INHERIT;                             \
          apr_pool_child_cleanup_set(the##name->pool,                 \
@@ -92,11 +92,11 @@
      if (the##name->flag & APR_FILE_NOCLEANUP)                       \
          return APR_EINVAL;                                          \
      if (the##name->flag & APR_INHERIT) {                            \
-+        int flags = fcntl(the##name->name##des, F_GETFD);           \
-+        if (flags == -1)                                            \
++        int fdflags = fcntl(the##name->name##des, F_GETFD);           \
++        if (fdflags == -1)                                            \
 +            return errno;                                           \
-+        flags |= FD_CLOEXEC;                                        \
-+        if (fcntl(the##name->name##des, F_SETFD, flags) == -1)      \
++        fdflags |= FD_CLOEXEC;                                        \
++        if (fcntl(the##name->name##des, F_SETFD, fdflags) == -1)      \
 +            return errno;                                           \
          the##name->flag &= ~APR_INHERIT;                            \
          apr_pool_child_cleanup_set(the##name->pool,                 \
@@ -109,7 +109,7 @@
                                 int protocol, apr_pool_t *cont)
  {
 -    int family = ofamily;
-+    int family = ofamily, flags = 0;
++    int family = ofamily, fdflags;
  
      if (family == APR_UNSPEC) {
  #if APR_HAVE_IPV6
@@ -117,11 +117,11 @@
      }
      set_socket_vars(*new, family, type, protocol);
  
-+    flags = fcntl((*new)->socketdes, F_GETFD);
-+    if (flags == -1)
++    fdflags = fcntl((*new)->socketdes, F_GETFD);
++    if (fdflags == -1)
 +        return errno;
-+    flags |= FD_CLOEXEC;
-+    if (fcntl((*new)->socketdes, F_SETFD, flags) == -1)
++    fdflags |= FD_CLOEXEC;
++    if (fcntl((*new)->socketdes, F_SETFD, fdflags) == -1)
 +        return errno;
 +
      (*new)->timeout = -1;
@@ -132,7 +132,7 @@
                                 apr_pool_t *connection_context)
  {
 -    int s;
-+    int s, flags;
++    int s, fdflags;
      apr_sockaddr_t sa;
  
      sa.salen = sizeof(sa.sa);
@@ -140,11 +140,11 @@
          (*new)->local_interface_unknown = 1;
      }
  
-+    flags = fcntl((*new)->socketdes, F_GETFD);
-+    if (flags == -1)
++    fdflags = fcntl((*new)->socketdes, F_GETFD);
++    if (fdflags == -1)
 +        return errno;
-+    flags |= FD_CLOEXEC;
-+    if (fcntl((*new)->socketdes, F_SETFD, flags) == -1)
++    fdflags |= FD_CLOEXEC;
++    if (fcntl((*new)->socketdes, F_SETFD, fdflags) == -1)
 +        return errno;
 +
      (*new)->inherit = 0;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/apr-bug-46425.patch?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list