diff options
author | Igor Sysoev <igor@sysoev.ru> | 2010-06-07 11:48:19 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2010-06-07 11:48:19 +0000 |
commit | 6b2bcfcd0da4bd77d3da7c7266716a2568fe889e (patch) | |
tree | 36cfe039fcad04d50345375683762c14663a80db | |
parent | 0625f491f427b4c4fc0b819ed6d0f5e1406d630c (diff) | |
download | nginx-6b2bcfcd0da4bd77d3da7c7266716a2568fe889e.tar.gz |
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
-rw-r--r-- | src/core/ngx_file.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c index 6844849ad..b5160f3ea 100644 --- a/src/core/ngx_file.c +++ b/src/core/ngx_file.c @@ -762,10 +762,12 @@ ngx_copy_file(u_char *from, u_char *to, ngx_copy_file_t *cf) size -= n; } - if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) { - ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, - ngx_set_file_time_n " \"%s\" failed", to); - goto failed; + if (cf->time != -1) { + if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) { + ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, + ngx_set_file_time_n " \"%s\" failed", to); + goto failed; + } } rc = NGX_OK; |