diff options
| author | Jim Meyering <jim@meyering.net> | 1993-08-26 04:38:30 +0000 |
|---|---|---|
| committer | Jim Meyering <jim@meyering.net> | 1993-08-26 04:38:30 +0000 |
| commit | 429043125e1842b92f1cdbc6c0a2772316c9d34e (patch) | |
| tree | a63cf2e0550e8c034c83e0703eab1dd82ffb9184 /lib/fsusage.c | |
| parent | merge with 3.8.1 (diff) | |
| download | coreutils-429043125e1842b92f1cdbc6c0a2772316c9d34e.tar.gz coreutils-429043125e1842b92f1cdbc6c0a2772316c9d34e.zip | |
merge with 3.8.2
Diffstat (limited to 'lib/fsusage.c')
| -rw-r--r-- | lib/fsusage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/fsusage.c b/lib/fsusage.c index c9ed26c87..9307a40b5 100644 --- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -58,7 +58,7 @@ int statvfs (); #endif /* Return the number of TOSIZE-byte blocks used by - BLOCKS FROMSIZE-byte blocks, rounding up. */ + BLOCKS FROMSIZE-byte blocks, rounding away from zero. */ static long adjust_blocks (blocks, fromsize, tosize) @@ -70,7 +70,7 @@ adjust_blocks (blocks, fromsize, tosize) else if (fromsize > tosize) /* E.g., from 2048 to 512. */ return blocks * (fromsize / tosize); else /* E.g., from 256 to 512. */ - return (blocks + 1) / (tosize / fromsize); + return (blocks + (blocks < 0 ? -1 : +1)) / (tosize / fromsize); } /* Fill in the fields of FSP with information about space usage for |
