aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_open_file_cache.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-04-22 10:06:43 +0000
committerIgor Sysoev <igor@sysoev.ru>2011-04-22 10:06:43 +0000
commitef1f33b0db5a69afeb4272668089ed5f760aea68 (patch)
tree5d654c5adb83ebb96f990ff3ae85930fc354fc8c /src/core/ngx_open_file_cache.c
parent64efecc2b5e6824422703a4fd5106c70d4704ef0 (diff)
downloadnginx-ef1f33b0db5a69afeb4272668089ed5f760aea68.tar.gz
nginx-ef1f33b0db5a69afeb4272668089ed5f760aea68.zip
Use more precise stat.st_blocks to account cache size on Unix
instead of file length rounded to a file system block size. There is no similar way on Windows, so rounding to a cache->bsize is kept.
Diffstat (limited to 'src/core/ngx_open_file_cache.c')
-rw-r--r--src/core/ngx_open_file_cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/ngx_open_file_cache.c b/src/core/ngx_open_file_cache.c
index a9c45324d..a70385c35 100644
--- a/src/core/ngx_open_file_cache.c
+++ b/src/core/ngx_open_file_cache.c
@@ -155,6 +155,7 @@ ngx_open_cached_file(ngx_open_file_cache_t *cache, ngx_str_t *name,
of->uniq = ngx_file_uniq(&fi);
of->mtime = ngx_file_mtime(&fi);
of->size = ngx_file_size(&fi);
+ of->fs_size = ngx_file_fs_size(&fi);
of->is_dir = ngx_is_dir(&fi);
of->is_file = ngx_is_file(&fi);
of->is_link = ngx_is_link(&fi);
@@ -557,6 +558,7 @@ done:
of->uniq = ngx_file_uniq(&fi);
of->mtime = ngx_file_mtime(&fi);
of->size = ngx_file_size(&fi);
+ of->fs_size = ngx_file_fs_size(&fi);
of->is_dir = ngx_is_dir(&fi);
of->is_file = ngx_is_file(&fi);
of->is_link = ngx_is_link(&fi);