From f68c80126e8c789b935f2dfa469c1bb8e2a26ded Mon Sep 17 00:00:00 2001 From: zyh Date: Fri, 27 Apr 2018 15:33:22 +0800 Subject: [PATCH] [Components][DFS]fix if disk free more than 4GB --- components/dfs/src/dfs_fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c index c1f31a2f8b..2090a7e363 100644 --- a/components/dfs/src/dfs_fs.c +++ b/components/dfs/src/dfs_fs.c @@ -554,8 +554,8 @@ int df(const char *path) return -1; } - cap = buffer.f_bsize * buffer.f_bfree / 1024; - for (unit_index = 0; unit_index < 3; unit_index ++) + cap = ((long long)buffer.f_bsize) * ((long long)buffer.f_bfree) / 1024LL; + for (unit_index = 0; unit_index < 2; unit_index ++) { if (cap < 1024) break;