mirror of
https://github.com/nginx/nginx.git
synced 2024-12-01 03:17:17 +08:00
Reorder checks in ngx_shared_memory_add() for more consistent error messages.
This commit is contained in:
parent
bfae21175a
commit
1c42128e50
@ -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 New Issue
Block a user