Mercurial > hg > nginx
comparison src/core/ngx_cycle.c @ 4902:db9ce6fc9482 stable-1.2
Merge of r4870, r4871, r4890, r4895: minor fixes.
*) Made sure to initialize the entire ngx_file_t structure.
Found by Coverity.
*) Correct plural form for "path" in the whole source base.
*) Removed conditional compilation from waitpid() error test.
There are reports that call to a signal handler for an exited process
despite waitpid() already called for the process may happen on Linux
as well.
*) Style, parentheses instead of braces in misc/GNUMakefile.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 12 Nov 2012 18:39:51 +0000 |
parents | a0f1d53546d4 |
children | bbcaeccbd928 |
comparison
equal
deleted
inserted
replaced
4901:a0cb7fc23cc2 | 4902:db9ce6fc9482 |
---|---|
116 ngx_destroy_pool(pool); | 116 ngx_destroy_pool(pool); |
117 return NULL; | 117 return NULL; |
118 } | 118 } |
119 | 119 |
120 | 120 |
121 n = old_cycle->pathes.nelts ? old_cycle->pathes.nelts : 10; | 121 n = old_cycle->paths.nelts ? old_cycle->paths.nelts : 10; |
122 | 122 |
123 cycle->pathes.elts = ngx_pcalloc(pool, n * sizeof(ngx_path_t *)); | 123 cycle->paths.elts = ngx_pcalloc(pool, n * sizeof(ngx_path_t *)); |
124 if (cycle->pathes.elts == NULL) { | 124 if (cycle->paths.elts == NULL) { |
125 ngx_destroy_pool(pool); | 125 ngx_destroy_pool(pool); |
126 return NULL; | 126 return NULL; |
127 } | 127 } |
128 | 128 |
129 cycle->pathes.nelts = 0; | 129 cycle->paths.nelts = 0; |
130 cycle->pathes.size = sizeof(ngx_path_t *); | 130 cycle->paths.size = sizeof(ngx_path_t *); |
131 cycle->pathes.nalloc = n; | 131 cycle->paths.nalloc = n; |
132 cycle->pathes.pool = pool; | 132 cycle->paths.pool = pool; |
133 | 133 |
134 | 134 |
135 if (old_cycle->open_files.part.nelts) { | 135 if (old_cycle->open_files.part.nelts) { |
136 n = old_cycle->open_files.part.nelts; | 136 n = old_cycle->open_files.part.nelts; |
137 for (part = old_cycle->open_files.part.next; part; part = part->next) { | 137 for (part = old_cycle->open_files.part.next; part; part = part->next) { |
332 if (ngx_test_lockfile(cycle->lock_file.data, log) != NGX_OK) { | 332 if (ngx_test_lockfile(cycle->lock_file.data, log) != NGX_OK) { |
333 goto failed; | 333 goto failed; |
334 } | 334 } |
335 | 335 |
336 | 336 |
337 if (ngx_create_pathes(cycle, ccf->user) != NGX_OK) { | 337 if (ngx_create_paths(cycle, ccf->user) != NGX_OK) { |
338 goto failed; | 338 goto failed; |
339 } | 339 } |
340 | 340 |
341 | 341 |
342 if (cycle->new_log.file == NULL) { | 342 if (cycle->new_log.file == NULL) { |
1036 | 1036 |
1037 ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "signal process started"); | 1037 ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "signal process started"); |
1038 | 1038 |
1039 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); | 1039 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); |
1040 | 1040 |
1041 ngx_memzero(&file, sizeof(ngx_file_t)); | |
1042 | |
1041 file.name = ccf->pid; | 1043 file.name = ccf->pid; |
1042 file.log = cycle->log; | 1044 file.log = cycle->log; |
1043 | 1045 |
1044 file.fd = ngx_open_file(file.name.data, NGX_FILE_RDONLY, | 1046 file.fd = ngx_open_file(file.name.data, NGX_FILE_RDONLY, |
1045 NGX_FILE_OPEN, NGX_FILE_DEFAULT_ACCESS); | 1047 NGX_FILE_OPEN, NGX_FILE_DEFAULT_ACCESS); |