Klaus Demo nginx / d08b65c
do not set file time in ngx_copy_file() if the time is -1, this fixes an issue when file is moved across devices Igor Sysoev 12 years ago
1 changed file(s) with 6 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
761761 size -= n;
762762 }
763763
764 if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) {
765 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
766 ngx_set_file_time_n " \"%s\" failed", to);
767 goto failed;
764 if (cf->time != -1) {
765 if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) {
766 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
767 ngx_set_file_time_n " \"%s\" failed", to);
768 goto failed;
769 }
768770 }
769771
770772 rc = NGX_OK;