瀏覽代碼

Merge pull request #1386 from uestczyh222/master

[Components][DFS]fix if disk free more than 4GB
Bernard Xiong 7 年之前
父節點
當前提交
aaece70c25
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      components/dfs/src/dfs_fs.c

+ 2 - 2
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;