merge r3482:

do not set file time in ngx_copy_file() if the time is -1,
this fixes an issue when file is moved across devices
This commit is contained in:
Igor Sysoev 2010-06-07 11:48:19 +00:00
parent 0625f491f4
commit 6b2bcfcd0d

View File

@ -762,10 +762,12 @@ ngx_copy_file(u_char *from, u_char *to, ngx_copy_file_t *cf)
size -= n; size -= n;
} }
if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) { if (cf->time != -1) {
ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) {
ngx_set_file_time_n " \"%s\" failed", to); ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
goto failed; ngx_set_file_time_n " \"%s\" failed", to);
goto failed;
}
} }
rc = NGX_OK; rc = NGX_OK;