]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Prove that statfs is available.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 12 Jan 2011 09:24:43 +0000 (04:24 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 12 Jan 2011 09:24:43 +0000 (04:24 -0500)
SVN-Revision: 2876

CMakeLists.txt
build/cmake/config.h.in
configure.ac
libarchive/archive_read_disk_posix.c

index 842f3315cc804f5c61322712e9e06be65c3e2fed..89c729d57a311a09457c3e46a0650ab11a06ce83 100644 (file)
@@ -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)
index ed3d9558bb2bdea2a00eb784eda0fc1fe2f2d513..4ed20e1a10b4db1a4c537169cfaa859a9f2db73d 100644 (file)
 /* Define to 1 if you have the <signal.h> 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
 
index 9442db57046d98672c6fe7dd378f78b93658214d..1daaab5e07993f47687d2ac044c217253a4f5a11 100644 (file)
@@ -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])
index da62d3ca50b7ec3220d0998eba1d04dc9b8bb607..dc58edc47112b810d0d02d095b398865fd05ac09 100644 (file)
@@ -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