X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffsusage.c;h=96860ebc51b0162df0a0f613a7453ee0e2f55091;hb=2e296bb50d37439d208c507bc8409336822a0c28;hp=9307a40b5ab142efb67383f22fc4e1e95cb461a1;hpb=e988749cf4d49ad0712ad377a0bec9374363a8ed;p=gnulib.git diff --git a/lib/fsusage.c b/lib/fsusage.c index 9307a40b5..96860ebc5 100644 --- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -15,12 +15,23 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifdef HAVE_CONFIG_H +#if defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else +#include "config.h" +#endif +#endif + #include #include "fsusage.h" int statfs (); -#if defined (STATFS_OSF1) /* DEC Alpha running OSF/1 */ +#if defined (STAT_STATFS3_OSF1) /* DEC Alpha running OSF/1 */ # include #endif @@ -70,7 +81,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 + (blocks < 0 ? -1 : +1)) / (tosize / fromsize); + return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize); } /* Fill in the fields of FSP with information about space usage for @@ -84,13 +95,13 @@ get_fs_usage (path, disk, fsp) char *path, *disk; struct fs_usage *fsp; { -#if defined (STATFS_OSF1) +#if defined (STAT_STATFS3_OSF1) struct statfs fsd; if (statfs (path, &fsd, sizeof (struct statfs)) != 0) return (-1); #define convert_blocks(b) adjust_blocks ((b),fsd.f_fsize, 512) -#endif /* STATFS_OSF1 */ +#endif /* STAT_STATFS3_OSF1 */ #ifdef STAT_STATFS2_FS_DATA /* Ultrix. */ struct fs_data fsd;