Mercurial > hg > nginx-quic
comparison src/core/nginx.c @ 2328:0ebecd0c3410 stable-0.6
r2303 merge:
compatibility with glibc 2.3, warn_unused_result attribute for write()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 20 Nov 2008 17:23:08 +0000 |
parents | 9f15e5f8ff9e |
children | 1804da35f853 |
comparison
equal
deleted
inserted
replaced
2327:be8c6159590b | 2328:0ebecd0c3410 |
---|---|
190 | 190 |
191 | 191 |
192 int ngx_cdecl | 192 int ngx_cdecl |
193 main(int argc, char *const *argv) | 193 main(int argc, char *const *argv) |
194 { | 194 { |
195 char *p; | |
196 ssize_t n; | |
195 ngx_int_t i; | 197 ngx_int_t i; |
196 ngx_log_t *log; | 198 ngx_log_t *log; |
197 ngx_cycle_t *cycle, init_cycle; | 199 ngx_cycle_t *cycle, init_cycle; |
198 ngx_core_conf_t *ccf; | 200 ngx_core_conf_t *ccf; |
199 | 201 |
239 if (ngx_getopt(&init_cycle, argc, ngx_argv) != NGX_OK) { | 241 if (ngx_getopt(&init_cycle, argc, ngx_argv) != NGX_OK) { |
240 return 1; | 242 return 1; |
241 } | 243 } |
242 | 244 |
243 if (ngx_show_version) { | 245 if (ngx_show_version) { |
244 ngx_write_fd(ngx_stderr_fileno, "nginx version: " NGINX_VER CRLF, | 246 |
245 sizeof("nginx version: " NGINX_VER CRLF) - 1); | 247 p = "nginx version: " NGINX_VER CRLF; |
248 n = sizeof("nginx version: " NGINX_VER CRLF) - 1; | |
249 | |
250 if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) { | |
251 return 1; | |
252 } | |
246 | 253 |
247 if (ngx_show_configure) { | 254 if (ngx_show_configure) { |
248 #ifdef NGX_COMPILER | 255 #ifdef NGX_COMPILER |
249 ngx_write_fd(ngx_stderr_fileno, "built by " NGX_COMPILER CRLF, | 256 p = "built by " NGX_COMPILER CRLF; |
250 sizeof("built by " NGX_COMPILER CRLF) - 1); | 257 n = sizeof("built by " NGX_COMPILER CRLF) - 1; |
251 #endif | 258 |
252 | 259 if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) { |
253 #ifndef __WATCOMC__ | 260 return 1; |
254 | 261 } |
255 /* OpenWatcomC could not build the long NGX_CONFIGURE string */ | 262 #endif |
256 | 263 |
257 ngx_write_fd(ngx_stderr_fileno, | 264 p = "configure arguments: " NGX_CONFIGURE CRLF; |
258 "configure arguments: " NGX_CONFIGURE CRLF, | 265 n = sizeof("configure arguments :" NGX_CONFIGURE CRLF) - 1; |
259 sizeof("configure arguments :" NGX_CONFIGURE CRLF) - 1); | 266 |
260 #endif | 267 if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) { |
268 return 1; | |
269 } | |
261 } | 270 } |
262 | 271 |
263 if (!ngx_test_config) { | 272 if (!ngx_test_config) { |
264 return 0; | 273 return 0; |
265 } | 274 } |