diff --git a/ChangeLog b/ChangeLog index 81f609b460..20137d1760 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Mon Apr 28 21:40:27 2014 NARUSE, Yui + + * configure.in (HAVE_STRUCT_STATFS_F_TYPE): check struct statfs.f_type + to support OpenBSD. + + * file.c (statfs_type): use above macro to switch. + + * file.c (statfs_inspect): ditto. + Mon Apr 28 18:06:08 2014 NARUSE, Yui * configure.in: check struct statvfs and struct statvfs.f_fstypename. diff --git a/configure.in b/configure.in index ad226151b0..29ae4f6c37 100644 --- a/configure.in +++ b/configure.in @@ -1736,7 +1736,7 @@ AC_CHECK_TYPES([struct statfs], [], [], [@%:@ifdef HAVE_SYS_PARAM_H @%:@ include @%:@endif]) AS_IF([test "$ac_cv_type_struct_statfs" = yes], [ -AC_CHECK_MEMBERS([struct statfs.f_fstypename], [], [], [@%:@ifdef HAVE_SYS_PARAM_H +AC_CHECK_MEMBERS([struct statfs.f_type, struct statfs.f_fstypename], [], [], [@%:@ifdef HAVE_SYS_PARAM_H @%:@ include @%:@endif @%:@ifdef HAVE_SYS_MOUNT_H diff --git a/file.c b/file.c index 0fbe7465b7..6fe9f40f55 100644 --- a/file.c +++ b/file.c @@ -5439,7 +5439,7 @@ rb_statfs_init_copy(VALUE copy, VALUE orig) return copy; } -#ifdef HAVE_STRUCT_STATFS +#ifdef HAVE_STRUCT_STATFS_F_TYPE /* * call-seq: * st.type -> fixnum @@ -5587,7 +5587,7 @@ statfs_inspect(VALUE self) { statfs_t *st = get_statfs(self); return rb_sprintf("#<%"PRIsVALUE" " -#ifdef HAVE_STRUCT_STATFS +#ifdef HAVE_STRUCT_STATFS_F_TYPE "type=%ld" #endif #if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME)