Mercurial > hg > nginx
comparison src/core/ngx_open_file_cache.c @ 4484:f78a29a2f9e6
Disable symlinks: error handling cleanup again.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 20 Feb 2012 19:14:07 +0000 |
parents | 5a3cb84545e5 |
children | f7d131008e9c |
comparison
equal
deleted
inserted
replaced
4483:15e3b7f867a9 | 4484:f78a29a2f9e6 |
---|---|
588 if (p[0] == '/') { | 588 if (p[0] == '/') { |
589 at_fd = ngx_openat_file(at_fd, "/", | 589 at_fd = ngx_openat_file(at_fd, "/", |
590 NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, | 590 NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, |
591 NGX_FILE_OPEN, 0); | 591 NGX_FILE_OPEN, 0); |
592 | 592 |
593 if (at_fd == NGX_FILE_ERROR) { | 593 if (at_fd == NGX_INVALID_FILE) { |
594 of->err = ngx_errno; | 594 of->err = ngx_errno; |
595 of->failed = ngx_openat_file_n; | 595 of->failed = ngx_openat_file_n; |
596 return NGX_FILE_ERROR; | 596 return NGX_INVALID_FILE; |
597 } | 597 } |
598 | 598 |
599 at_name.len = 1; | 599 at_name.len = 1; |
600 p++; | 600 p++; |
601 } | 601 } |
632 goto failed; | 632 goto failed; |
633 } | 633 } |
634 | 634 |
635 if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { | 635 if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { |
636 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | 636 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, |
637 ngx_close_file_n " \"%V\" failed", at_name); | 637 ngx_close_file_n " \"%V\" failed", &at_name); |
638 } | 638 } |
639 | 639 |
640 p = cp + 1; | 640 p = cp + 1; |
641 at_fd = fd; | 641 at_fd = fd; |
642 at_name.len = cp - at_name.data; | 642 at_name.len = cp - at_name.data; |
690 | 690 |
691 failed: | 691 failed: |
692 | 692 |
693 if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { | 693 if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { |
694 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | 694 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, |
695 ngx_close_file_n " \"%V\" failed", at_name); | 695 ngx_close_file_n " \"%V\" failed", &at_name); |
696 } | 696 } |
697 | 697 |
698 return fd; | 698 return fd; |
699 #endif | 699 #endif |
700 } | 700 } |