[nginx] svn commit: r4778 - trunk/src/core

defan at nginx.com defan at nginx.com
Wed Aug 1 14:37:09 UTC 2012


Author: defan
Date: 2012-08-01 14:37:08 +0000 (Wed, 01 Aug 2012)
New Revision: 4778
URL: http://trac.nginx.org/nginx/changeset/4778/nginx

Log:
Reorder checks in ngx_shared_memory_add() for more consistent error messages.


Modified:
   trunk/src/core/ngx_cycle.c

Modified: trunk/src/core/ngx_cycle.c
===================================================================
--- trunk/src/core/ngx_cycle.c	2012-07-31 21:49:23 UTC (rev 4777)
+++ trunk/src/core/ngx_cycle.c	2012-08-01 14:37:08 UTC (rev 4778)
@@ -1285,6 +1285,14 @@
             continue;
         }
 
+        if (tag != shm_zone[i].tag) {
+            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                            "the shared memory zone \"%V\" is "
+                            "already declared for a different use",
+                            &shm_zone[i].shm.name);
+            return NULL;
+        }
+
         if (size && size != shm_zone[i].shm.size) {
             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                             "the size %uz of shared memory zone \"%V\" "
@@ -1293,14 +1301,6 @@
             return NULL;
         }
 
-        if (tag != shm_zone[i].tag) {
-            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                            "the shared memory zone \"%V\" is "
-                            "already declared for a different use",
-                            &shm_zone[i].shm.name);
-            return NULL;
-        }
-
         return &shm_zone[i];
     }
 



More information about the nginx-devel mailing list