diff options
author | Tim Prouty <tprouty@samba.org> | 2008-10-13 11:50:27 -0700 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2008-10-13 14:24:08 -0700 |
commit | 0a33d8bd312cc4497d08bbe0f4dd2abcce67bd0b (patch) | |
tree | fd4aff08971ad2ff3111fa43c8d3b29bc0f0aa75 /lib/util/fsusage.c | |
parent | 783818d956fd6e22d1affae808f240b6189e3140 (diff) | |
download | samba-0a33d8bd312cc4497d08bbe0f4dd2abcce67bd0b.tar.gz samba-0a33d8bd312cc4497d08bbe0f4dd2abcce67bd0b.tar.bz2 samba-0a33d8bd312cc4497d08bbe0f4dd2abcce67bd0b.zip |
Check for f_frsize when using statvfs
Add a configure test for the availability of f_frsize in struct
statvfs (for broken platforms that define statvfs but still have
f_bsize/f_iosize). Ported from source3's fsusage:
commit 472519eb6941bc0972212cc416ab89801fe3ee0c
Diffstat (limited to 'lib/util/fsusage.c')
-rw-r--r-- | lib/util/fsusage.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/util/fsusage.c b/lib/util/fsusage.c index 43c8787216..30f9f9c795 100644 --- a/lib/util/fsusage.c +++ b/lib/util/fsusage.c @@ -124,8 +124,13 @@ _PUBLIC_ int sys_fsusage(const char *path, uint64_t *dfree, uint64_t *dsize) #endif /* STAT_STATFS4 */ #if defined(STAT_STATVFS) || defined(STAT_STATVFS64) /* SVR4 */ +#ifdef HAVE_FRSIZE # define CONVERT_BLOCKS(B) \ adjust_blocks ((uint64_t)(B), fsd.f_frsize ? (uint64_t)fsd.f_frsize : (uint64_t)fsd.f_bsize, (uint64_t)512) +#else +# define CONVERT_BLOCKS(B) \ + adjust_blocks ((uint64_t)(B), (uint64_t)fsd.f_bsize, (uint64_t)512) +#endif #ifdef STAT_STATVFS64 struct statvfs64 fsd; |