From: Michihiro NAKAJIMA Date: Tue, 25 Jan 2011 19:55:43 +0000 (-0500) Subject: Improve checking of statfs in LSB. X-Git-Tag: v3.0.0a~716 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cb2837dc7be8ade272e0956e53d8f2be62fdd38;p=thirdparty%2Flibarchive.git Improve checking of statfs in LSB. Use HAVE_SYS_STATFS_H to use statfs on linux instead of HAVE_SYS_VFS_H and add checking of HAVE_SYS_STATVFS_H to use statvfs. SVN-Revision: 2946 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f755ff10f..f2029aaf4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,6 +249,7 @@ LA_CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H) LA_CHECK_INCLUDE_FILE("sys/poll.h" HAVE_SYS_POLL_H) LA_CHECK_INCLUDE_FILE("sys/select.h" HAVE_SYS_SELECT_H) LA_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) +LA_CHECK_INCLUDE_FILE("sys/statfs.h" HAVE_SYS_STATFS_H) LA_CHECK_INCLUDE_FILE("sys/statvfs.h" HAVE_SYS_STATVFS_H) LA_CHECK_INCLUDE_FILE("sys/time.h" HAVE_SYS_TIME_H) LA_CHECK_INCLUDE_FILE("sys/utime.h" HAVE_SYS_UTIME_H) diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in index 1b886b804..283734d6f 100644 --- a/build/cmake/config.h.in +++ b/build/cmake/config.h.in @@ -775,6 +775,9 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SELECT_H 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STATFS_H 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_STATVFS_H 1 diff --git a/configure.ac b/configure.ac index a8b2bcfba..84f762dbd 100644 --- a/configure.ac +++ b/configure.ac @@ -202,7 +202,7 @@ AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h regex.h signal.h stdarg.h]) AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) AC_CHECK_HEADERS([sys/acl.h sys/cdefs.h sys/extattr.h sys/ioctl.h]) AC_CHECK_HEADERS([sys/mkdev.h sys/mount.h]) -AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/statvfs.h]) +AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/statfs.h sys/statvfs.h]) AC_CHECK_HEADERS([sys/time.h sys/utime.h sys/utsname.h sys/vfs.h]) AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h wctype.h]) AC_CHECK_HEADERS([windows.h winioctl]) diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index 769ebeed9..6c15549a9 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -40,15 +40,15 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_SYS_STAT_H #include #endif +#ifdef HAVE_SYS_STATFS_H +#include +#endif #ifdef HAVE_SYS_STATVFS_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif -#ifdef HAVE_SYS_VFS_H -#include -#endif #ifdef HAVE_LINUX_MAGIC_H #include #endif @@ -1407,8 +1407,8 @@ setup_current_filesystem(struct archive_read_disk *a) return (ARCHIVE_OK); } -#elif defined(HAVE_SYS_VFS_H) && defined(HAVE_LINUX_MAGIC_H) &&\ - (defined(HAVE_STATFS) || defined(HAVE_FSTATFS)) +#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_LINUX_MAGIC_H) &&\ + defined(HAVE_STATFS) && defined(HAVE_FSTATFS) /* * Note: statfs is deprecated since LSB 3.2 */ @@ -1518,7 +1518,8 @@ setup_current_filesystem(struct archive_read_disk *a) return (ARCHIVE_OK); } -#elif defined(HAVE_STATVFS) || defined(HAVE_FSTATVFS) +#elif defined(HAVE_SYS_STATVFS_H) &&\ + (defined(HAVE_STATVFS) || defined(HAVE_FSTATVFS)) /* * Gather current filesystem properties on other posix platform.