comparison src/core/nginx.c @ 270:6eb1e38f0f1f NGINX_0_5_5

nginx 0.5.5 *) Change: the -v switch does not show compiler information any more. *) Feature: the -V switch. *) Feature: the "worker_rlimit_core" directive supports size in K, M, and G. *) Bugfix: the nginx.pm module now could be installed by an unprivileged user. *) Bugfix: a segmentation fault might occur if the $r->request_body or $r->request_body_file methods were used. *) Bugfix: the ppc platform specific bugs.
author Igor Sysoev <http://sysoev.ru>
date Sun, 24 Dec 2006 00:00:00 +0300
parents 6ae1357b7b7c
children 704622b2528a
comparison
equal deleted inserted replaced
269:aa9c0062124d 270:6eb1e38f0f1f
107 offsetof(ngx_core_conf_t, rlimit_nofile), 107 offsetof(ngx_core_conf_t, rlimit_nofile),
108 NULL }, 108 NULL },
109 109
110 { ngx_string("worker_rlimit_core"), 110 { ngx_string("worker_rlimit_core"),
111 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1, 111 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
112 ngx_conf_set_num_slot, 112 ngx_conf_set_size_slot,
113 0, 113 0,
114 offsetof(ngx_core_conf_t, rlimit_core), 114 offsetof(ngx_core_conf_t, rlimit_core),
115 NULL }, 115 NULL },
116 116
117 { ngx_string("worker_rlimit_sigpending"), 117 { ngx_string("worker_rlimit_sigpending"),
174 174
175 175
176 ngx_uint_t ngx_max_module; 176 ngx_uint_t ngx_max_module;
177 177
178 static ngx_uint_t ngx_show_version; 178 static ngx_uint_t ngx_show_version;
179 static ngx_uint_t ngx_show_configure;
179 180
180 static char *ngx_null_environ = NULL; 181 static char *ngx_null_environ = NULL;
181 182
182 183
183 int ngx_cdecl 184 int ngx_cdecl
233 234
234 if (ngx_show_version) { 235 if (ngx_show_version) {
235 ngx_write_fd(ngx_stderr_fileno, "nginx version: " NGINX_VER CRLF, 236 ngx_write_fd(ngx_stderr_fileno, "nginx version: " NGINX_VER CRLF,
236 sizeof("nginx version: " NGINX_VER CRLF) - 1); 237 sizeof("nginx version: " NGINX_VER CRLF) - 1);
237 238
239 if (ngx_show_configure) {
238 #ifdef NGX_COMPILER 240 #ifdef NGX_COMPILER
239 ngx_write_fd(ngx_stderr_fileno, "built by " NGX_COMPILER CRLF, 241 ngx_write_fd(ngx_stderr_fileno, "built by " NGX_COMPILER CRLF,
240 sizeof("built by " NGX_COMPILER CRLF) - 1); 242 sizeof("built by " NGX_COMPILER CRLF) - 1);
241 #endif 243 #endif
244
245 #ifndef __WATCOMC__
246
247 /* OpenWatcomC could not build the long NGX_CONFIGURE string */
248
249 ngx_write_fd(ngx_stderr_fileno,
250 "configure arguments: " NGX_CONFIGURE CRLF,
251 sizeof("configure arguments :" NGX_CONFIGURE CRLF) - 1);
252 #endif
253 }
254
242 if (!ngx_test_config) { 255 if (!ngx_test_config) {
243 return 0; 256 return 0;
244 } 257 }
245 } 258 }
246 259
247 if (ngx_test_config) { 260 if (ngx_test_config) {
248 log->log_level = NGX_LOG_INFO; 261 log->log_level = NGX_LOG_INFO;
249 } 262 }
250 263
251 if (ngx_os_init(log) != NGX_OK) { 264 if (ngx_os_init(log) != NGX_OK) {
265 return 1;
266 }
267
268 /* ngx_crc32_init() requires ngx_cacheline_size set in ngx_os_init() */
269
270 if (ngx_crc32_init() != NGX_OK) {
252 return 1; 271 return 1;
253 } 272 }
254 273
255 if (ngx_add_inherited_sockets(&init_cycle) != NGX_OK) { 274 if (ngx_add_inherited_sockets(&init_cycle) != NGX_OK) {
256 return 1; 275 return 1;
280 cycle->conf_file.data); 299 cycle->conf_file.data);
281 return 0; 300 return 0;
282 } 301 }
283 302
284 ngx_os_status(cycle->log); 303 ngx_os_status(cycle->log);
285
286 if (ngx_crc32_init(cycle->pool) != NGX_OK) {
287 return 1;
288 }
289 304
290 ngx_cycle = cycle; 305 ngx_cycle = cycle;
291 306
292 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); 307 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
293 308
494 509
495 case 'v': 510 case 'v':
496 ngx_show_version = 1; 511 ngx_show_version = 1;
497 break; 512 break;
498 513
514 case 'V':
515 ngx_show_version = 1;
516 ngx_show_configure = 1;
517 break;
518
499 case 't': 519 case 't':
500 ngx_test_config = 1; 520 ngx_test_config = 1;
501 break; 521 break;
502 522
503 case 'c': 523 case 'c':
598 618
599 ccf->worker_processes = NGX_CONF_UNSET; 619 ccf->worker_processes = NGX_CONF_UNSET;
600 ccf->debug_points = NGX_CONF_UNSET; 620 ccf->debug_points = NGX_CONF_UNSET;
601 621
602 ccf->rlimit_nofile = NGX_CONF_UNSET; 622 ccf->rlimit_nofile = NGX_CONF_UNSET;
603 ccf->rlimit_core = NGX_CONF_UNSET; 623 ccf->rlimit_core = NGX_CONF_UNSET_SIZE;
604 ccf->rlimit_sigpending = NGX_CONF_UNSET; 624 ccf->rlimit_sigpending = NGX_CONF_UNSET;
605 625
606 ccf->user = (ngx_uid_t) NGX_CONF_UNSET_UINT; 626 ccf->user = (ngx_uid_t) NGX_CONF_UNSET_UINT;
607 ccf->group = (ngx_gid_t) NGX_CONF_UNSET_UINT; 627 ccf->group = (ngx_gid_t) NGX_CONF_UNSET_UINT;
608 628