Skip to content

Commit

Permalink
Improve checking of statfs in LSB.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ggcueroad committed Jan 25, 2011
1 parent e5c2486 commit 0cb2837
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions build/cmake/config.h.in
Expand Up @@ -775,6 +775,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the <sys/select.h> header file. */
#cmakedefine HAVE_SYS_SELECT_H 1

/* Define to 1 if you have the <sys/statfs.h> header file. */
#cmakedefine HAVE_SYS_STATFS_H 1

/* Define to 1 if you have the <sys/statvfs.h> header file. */
#cmakedefine HAVE_SYS_STATVFS_H 1

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -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])
Expand Down
13 changes: 7 additions & 6 deletions libarchive/archive_read_disk_posix.c
Expand Up @@ -40,15 +40,15 @@ __FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_SYS_STATFS_H
#include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
#ifdef HAVE_LINUX_MAGIC_H
#include <linux/magic.h>
#endif
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0cb2837

Please sign in to comment.