diff options
author | Andrey Belov <defan@nginx.com> | 2012-08-01 14:37:08 +0000 |
---|---|---|
committer | Andrey Belov <defan@nginx.com> | 2012-08-01 14:37:08 +0000 |
commit | 1c42128e5052896bc16c97448d51a187326c6333 (patch) | |
tree | 158e288ce2003d6481f89a5e6576dd5c106ab309 /src/core | |
parent | bfae21175ab4a1e8a745f80564e23277fa72eb8a (diff) | |
download | nginx-1c42128e5052896bc16c97448d51a187326c6333.tar.gz nginx-1c42128e5052896bc16c97448d51a187326c6333.zip |
Reorder checks in ngx_shared_memory_add() for more consistent error messages.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ngx_cycle.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c index 2da0bf91a..e5468ae9b 100644 --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -1285,14 +1285,6 @@ ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name, size_t size, void *tag) continue; } - 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\" " - "conflicts with already declared size %uz", - size, &shm_zone[i].shm.name, shm_zone[i].shm.size); - return NULL; - } - if (tag != shm_zone[i].tag) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "the shared memory zone \"%V\" is " @@ -1301,6 +1293,14 @@ ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name, size_t size, void *tag) 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\" " + "conflicts with already declared size %uz", + size, &shm_zone[i].shm.name, shm_zone[i].shm.size); + return NULL; + } + return &shm_zone[i]; } |