aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-23 02:32:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-23 02:32:17 +0000
commit0f69c1845a1d60399a6362e9e9332324e2a254e2 (patch)
treeb63244d1b32fa9e3ace9c57c721cfbc394d9f245 /file.c
parent2c14872b9f32a6ed06aaf1711c92a70cb19aa3e0 (diff)
downloadruby-0f69c1845a1d60399a6362e9e9332324e2a254e2.tar.gz
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
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 4 insertions, 0 deletions
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