Mercurial > hg > nginx
comparison src/core/nginx.c @ 212:679f60139863
nginx-0.0.1-2003-12-19-11:15:11 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 19 Dec 2003 08:15:11 +0000 |
parents | 00cafae0bdf1 |
children | f1d0e5f09c1e |
comparison
equal
deleted
inserted
replaced
211:fd9fecc4193f | 212:679f60139863 |
---|---|
70 int main(int argc, char *const *argv) | 70 int main(int argc, char *const *argv) |
71 { | 71 { |
72 int i; | 72 int i; |
73 ngx_fd_t fd; | 73 ngx_fd_t fd; |
74 ngx_log_t *log; | 74 ngx_log_t *log; |
75 ngx_cycle_t *cycle; | 75 ngx_cycle_t *cycle, init_cycle; |
76 ngx_open_file_t *file; | 76 ngx_open_file_t *file; |
77 #if !(WIN32) | 77 #if !(WIN32) |
78 size_t len; | 78 size_t len; |
79 char pid[/* STUB */ 10]; | 79 char pid[/* STUB */ 10]; |
80 ngx_file_t pidfile; | 80 ngx_file_t pidfile; |
86 #endif | 86 #endif |
87 | 87 |
88 /* TODO */ ngx_max_sockets = -1; | 88 /* TODO */ ngx_max_sockets = -1; |
89 | 89 |
90 ngx_time_init(); | 90 ngx_time_init(); |
91 #if (HAVE_PCRE) | |
91 ngx_regex_init(); | 92 ngx_regex_init(); |
93 #endif | |
92 | 94 |
93 log = ngx_log_init_errlog(); | 95 log = ngx_log_init_errlog(); |
96 | |
97 | |
98 /* init_cycle->log is required for signal handlers */ | |
99 | |
100 ngx_memzero(&init_cycle, sizeof(ngx_cycle_t)); | |
101 init_cycle.log = log; | |
102 ngx_cycle = &init_cycle; | |
94 | 103 |
95 if (ngx_os_init(log) == NGX_ERROR) { | 104 if (ngx_os_init(log) == NGX_ERROR) { |
96 return 1; | 105 return 1; |
97 } | 106 } |
98 | 107 |
205 cycle->log, 0, "exiting"); | 214 cycle->log, 0, "exiting"); |
206 exit(0); | 215 exit(0); |
207 } | 216 } |
208 | 217 |
209 if (rotate) { | 218 if (rotate) { |
210 ngx_log_error(NGX_LOG_INFO, cycle->log, 0, "rotating logs"); | 219 ngx_log_error(NGX_LOG_INFO, cycle->log, 0, "reopen logs"); |
211 | 220 |
212 file = cycle->open_files.elts; | 221 file = cycle->open_files.elts; |
213 for (i = 0; i < cycle->open_files.nelts; i++) { | 222 for (i = 0; i < cycle->open_files.nelts; i++) { |
214 if (file[i].name.data == NULL) { | 223 if (file[i].name.data == NULL) { |
215 continue; | 224 continue; |