mirror of
https://github.com/nginx/nginx.git
synced 2025-06-09 10:52:47 +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;
|
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) {
|
if (tag != shm_zone[i].tag) {
|
||||||
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
||||||
"the shared memory zone \"%V\" is "
|
"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;
|
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];
|
return &shm_zone[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user