summaryrefslogtreecommitdiffstats
path: root/libs/diskusage
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2013-05-01 10:10:59 -0700
committerMarco Nelissen <marcone@google.com>2013-05-01 10:10:59 -0700
commit7719b85bf89530c88807ce605308ffc3d50f3b58 (patch)
treee4146c32fa73ae6c2d0a4c4044cdd9ebc16616bb /libs/diskusage
parentf6d1c3930eeba6b089ba12fb82ecad1c6622e550 (diff)
downloadframeworks_native-7719b85bf89530c88807ce605308ffc3d50f3b58.zip
frameworks_native-7719b85bf89530c88807ce605308ffc3d50f3b58.tar.gz
frameworks_native-7719b85bf89530c88807ce605308ffc3d50f3b58.tar.bz2
Report actual disk space used
Report size based on blocks used, not the "nominal" size. b/8744465 Change-Id: Idbb72f47af6d475b51305a14be291bf01acb14bb
Diffstat (limited to 'libs/diskusage')
-rw-r--r--libs/diskusage/dirsize.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/diskusage/dirsize.c b/libs/diskusage/dirsize.c
index 6703783..24e5af0 100644
--- a/libs/diskusage/dirsize.c
+++ b/libs/diskusage/dirsize.c
@@ -24,7 +24,8 @@
int64_t stat_size(struct stat *s)
{
int64_t blksize = s->st_blksize;
- int64_t size = s->st_size;
+ // count actual blocks used instead of nominal file size
+ int64_t size = s->st_blocks * 512;
if (blksize) {
/* round up to filesystem block size */