1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2014-04-28 12:46:23 +00:00
parent 559d689ca6
commit 19fac4432f
3 changed files with 12 additions and 3 deletions

View file

@ -1,3 +1,12 @@
Mon Apr 28 21:40:27 2014 NARUSE, Yui <naruse@ruby-lang.org>
* 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 <naruse@ruby-lang.org>
* configure.in: check struct statvfs and struct statvfs.f_fstypename.

View file

@ -1736,7 +1736,7 @@ AC_CHECK_TYPES([struct statfs], [], [], [@%:@ifdef HAVE_SYS_PARAM_H
@%:@ include <sys/vfs.h>
@%:@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 <sys/param.h>
@%:@endif
@%:@ifdef HAVE_SYS_MOUNT_H

4
file.c
View file

@ -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)