diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-10-11 15:45:00 -0700 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2013-02-02 16:44:15 -0800 |
commit | 5196558fde38105636032f38e9d6be6e244fa753 (patch) | |
tree | ad1c4aab6466ff379105934f33c0490917cc854b | |
parent | 050767f235b7c5790975f7156be561da8abe299d (diff) | |
download | rpm-5196558fde38105636032f38e9d6be6e244fa753.tar.gz rpm-5196558fde38105636032f38e9d6be6e244fa753.tar.bz2 rpm-5196558fde38105636032f38e9d6be6e244fa753.zip |
Prefer sys/vfs.h, as statvfs stats all filesystems again
-rw-r--r-- | configure.ac | 14 | ||||
-rw-r--r-- | lib/transaction.c | 4 |
2 files changed, 11 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 09d81a87e..7a8a3085e 100644 --- a/configure.ac +++ b/configure.ac @@ -400,25 +400,25 @@ dnl found_struct_statfs=no if test X$found_struct_statfs = Xno ; then -dnl Solaris 2.6+ wants to use statvfs +dnl first try including sys/vfs.h AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#include <sys/statvfs.h> ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h) - AC_DEFINE(STATFS_IN_SYS_STATVFS, 1, - [statfs in <sys/statvfs.h> (for solaris 2.6+ systems)]) +#include <sys/vfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h) + AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in <sys/vfs.h> (for linux systems)]) found_struct_statfs=yes],[]) fi if test X$found_struct_statfs = Xno ; then -dnl first try including sys/vfs.h +dnl Solaris 2.6+ wants to use statvfs AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#include <sys/vfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h) - AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in <sys/vfs.h> (for linux systems)]) +#include <sys/statvfs.h> ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h) + AC_DEFINE(STATFS_IN_SYS_STATVFS, 1, + [statfs in <sys/statvfs.h> (for solaris 2.6+ systems)]) found_struct_statfs=yes],[]) fi diff --git a/lib/transaction.c b/lib/transaction.c index 9d8dbcf0a..5e43880ab 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -117,7 +117,11 @@ static rpmDiskSpaceInfo rpmtsCreateDSI(const rpmts ts, dev_t dev, dsi->bneeded = 0; dsi->ineeded = 0; #ifdef STATFS_HAS_F_BAVAIL +# ifdef ST_RDONLY dsi->bavail = (sfb.f_flag & ST_RDONLY) ? 0 : sfb.f_bavail; +# else + dsi->bavail = sfb.f_bavail; +# endif #else /* FIXME: the statfs struct doesn't have a member to tell how many blocks are * available for non-superusers. f_blocks - f_bfree is probably too big, but |