From 0f69c1845a1d60399a6362e9e9332324e2a254e2 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 23 Apr 2014 02:32:17 +0000 Subject: [PATCH] file.c: fsid_t may not be defined * configure.in: check if fsid_t is defined. * file.c (statfs_fsid): fsid_t may not be defined, assume long in that case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 11 +++++++++++ file.c | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/configure.in b/configure.in index d44a3c5c5f..03d6596db4 100644 --- a/configure.in +++ b/configure.in @@ -1732,6 +1732,7 @@ AC_CHECK_TYPES([struct statfs], [], [], [@%:@ifdef HAVE_SYS_PARAM_H @%:@ifdef HAVE_SYS_VFS_H @%:@ include @%:@endif]) +AS_IF([test "$ac_cv_type_struct_statfs" = yes], [ AC_CHECK_MEMBERS([struct statfs.f_fstypename], [], [], [@%:@ifdef HAVE_SYS_PARAM_H @%:@ include @%:@endif @@ -1741,6 +1742,16 @@ AC_CHECK_MEMBERS([struct statfs.f_fstypename], [], [], [@%:@ifdef HAVE_SYS_PARAM @%:@ifdef HAVE_SYS_VFS_H @%:@ include @%:@endif]) +AC_CHECK_TYPES([fsid_t], [], [], [@%:@ifdef HAVE_SYS_PARAM_H +@%:@ include +@%:@endif +@%:@ifdef HAVE_SYS_MOUNT_H +@%:@ include +@%:@endif +@%:@ifdef HAVE_SYS_VFS_H +@%:@ include +@%:@endif]) +]) AC_CHECK_TYPES([clockid_t], [], [], [@%:@ifdef HAVE_TIME_H @%:@ include diff --git a/file.c b/file.c index 8c455121de..e171d0d9f8 100644 --- a/file.c +++ b/file.c @@ -5540,12 +5540,16 @@ statfs_ffree(VALUE self) static VALUE statfs_fsid(VALUE self) { +#ifdef HAVE_FSID_T union { uint64_t v; fsid_t f; } n = {0}; n.f = get_statfs(self)->f_fsid; return LL2NUM(n.v); +#else + return LONG2NUM(get_statfs(self)->f_fsid); +#endif } #ifdef HAVE_STRUCT_STATFS_F_FSTYPENAME