comparison src/core/ngx_file.c @ 1704:e584e946e198

move condition declarations inside blocks where they are used
author Igor Sysoev <igor@sysoev.ru>
date Mon, 10 Dec 2007 12:09:51 +0000
parents 8c4532a48b0a
children 442a791354d8
comparison
equal deleted inserted replaced
1703:43747661804d 1704:e584e946e198
423 ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user) 423 ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user)
424 { 424 {
425 ngx_err_t err; 425 ngx_err_t err;
426 ngx_uint_t i; 426 ngx_uint_t i;
427 ngx_path_t **path; 427 ngx_path_t **path;
428 #if !(NGX_WIN32)
429 ngx_file_info_t fi;
430 #endif
431 428
432 path = cycle->pathes.elts; 429 path = cycle->pathes.elts;
433 for (i = 0; i < cycle->pathes.nelts; i++) { 430 for (i = 0; i < cycle->pathes.nelts; i++) {
434 431
435 if (ngx_create_dir(path[i]->name.data, 0700) == NGX_FILE_ERROR) { 432 if (ngx_create_dir(path[i]->name.data, 0700) == NGX_FILE_ERROR) {
445 if (user == (ngx_uid_t) NGX_CONF_UNSET_UINT) { 442 if (user == (ngx_uid_t) NGX_CONF_UNSET_UINT) {
446 continue; 443 continue;
447 } 444 }
448 445
449 #if !(NGX_WIN32) 446 #if !(NGX_WIN32)
447 {
448 ngx_file_info_t fi;
450 449
451 if (ngx_file_info((const char *) path[i]->name.data, &fi) == -1) { 450 if (ngx_file_info((const char *) path[i]->name.data, &fi) == -1) {
452 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, 451 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
453 ngx_file_info_n " \"%s\" failed", path[i]->name.data); 452 ngx_file_info_n " \"%s\" failed", path[i]->name.data);
454 return NGX_ERROR; 453 return NGX_ERROR;
472 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, 471 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
473 "chmod() \"%s\" failed", path[i]->name.data); 472 "chmod() \"%s\" failed", path[i]->name.data);
474 return NGX_ERROR; 473 return NGX_ERROR;
475 } 474 }
476 } 475 }
477 476 }
478 #endif 477 #endif
479 } 478 }
480 479
481 return NGX_OK; 480 return NGX_OK;
482 } 481 }