Reorder checks in ngx_shared_memory_add() for more consistent error messages.
This commit is contained in:
parent
e6f5594097
commit
3f34a664cb
1 changed files with 8 additions and 8 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue