From: Michihiro NAKAJIMA Date: Wed, 12 Jan 2011 09:24:43 +0000 (-0500) Subject: Prove that statfs is available. X-Git-Tag: v3.0.0a~774 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ba1f7d79e9c81ebec3ec95762dcd680e6a04093;p=thirdparty%2Flibarchive.git Prove that statfs is available. SVN-Revision: 2876 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 842f3315c..89c729d57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -517,6 +517,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(select HAVE_SELECT) CHECK_FUNCTION_EXISTS_GLIBC(setenv HAVE_SETENV) CHECK_FUNCTION_EXISTS_GLIBC(setlocale HAVE_SETLOCALE) CHECK_FUNCTION_EXISTS_GLIBC(sigaction HAVE_SIGACTION) +CHECK_FUNCTION_EXISTS_GLIBC(statfs HAVE_STATFS) CHECK_FUNCTION_EXISTS_GLIBC(statvfs HAVE_STATVFS) CHECK_FUNCTION_EXISTS_GLIBC(strchr HAVE_STRCHR) CHECK_FUNCTION_EXISTS_GLIBC(strdup HAVE_STRDUP) diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in index ed3d9558b..4ed20e1a1 100644 --- a/build/cmake/config.h.in +++ b/build/cmake/config.h.in @@ -471,6 +471,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SIGNAL_H 1 +/* Define to 1 if you have the `statvfs' function. */ +#cmakedefine HAVE_STATFS 1 + /* Define to 1 if you have the `statvfs' function. */ #cmakedefine HAVE_STATVFS 1 diff --git a/configure.ac b/configure.ac index 9442db570..1daaab5e0 100644 --- a/configure.ac +++ b/configure.ac @@ -419,7 +419,7 @@ AC_CHECK_FUNCS([getgrgid_r getgrnam_r getpwnam_r getpwuid_r gmtime_r]) AC_CHECK_FUNCS([lchflags lchmod lchown link localtime_r lstat]) AC_CHECK_FUNCS([lutimes mbrtowc memmove memset mkdir mkfifo mknod mkstemp]) AC_CHECK_FUNCS([nl_langinfo pipe poll readdir_r readlink]) -AC_CHECK_FUNCS([select setenv setlocale sigaction statvfs]) +AC_CHECK_FUNCS([select setenv setlocale sigaction statfs statvfs]) AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strrchr symlink timegm]) AC_CHECK_FUNCS([tzset unsetenv utime utimensat utimes vfork]) AC_CHECK_FUNCS([wcrtomb wcscmp wcscpy wcslen wctomb wmemcmp wmemcpy]) diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index da62d3ca5..dc58edc47 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -910,7 +910,8 @@ archive_read_disk_current_filesystem_is_remote(struct archive *_a) #if defined(__FreeBSD__) || \ (defined(HAVE_STATVFS) && defined(ST_LOCAL)) || \ - (defined(HAVE_SYS_VFS_H) && defined(HAVE_LINUX_MAGIC_H)) + (defined(HAVE_SYS_VFS_H) && defined(HAVE_LINUX_MAGIC_H) && \ + defined(HAVE_STATFS)) /* * If symlink is broken, statfs or statvfs will fail. @@ -1011,7 +1012,12 @@ setup_current_filesystem(struct archive_read_disk *a) return (ARCHIVE_OK); } -#elif defined(HAVE_SYS_VFS_H) && defined(HAVE_LINUX_MAGIC_H) +#elif defined(HAVE_SYS_VFS_H) && defined(HAVE_LINUX_MAGIC_H) &&\ + defined(HAVE_STATFS) +/* + * Note: statfs is deprecated since LSB 3.2 + */ + #ifndef CIFS_SUPER_MAGIC #define CIFS_SUPER_MAGIC 0xFF534D42 #endif