summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-11 20:27:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-11 20:27:07 +0000
commit024023d6227739c3fb0cd61434ac86cebd75bfc8 (patch)
tree25da79425be444a6fe8baa485c701f90034a1561 /file.c
parent982d734c959248e273579b09c6c7b147e8fb5d5f (diff)
downloadruby-024023d6227739c3fb0cd61434ac86cebd75bfc8.tar.gz
ruby-024023d6227739c3fb0cd61434ac86cebd75bfc8.tar.xz
ruby-024023d6227739c3fb0cd61434ac86cebd75bfc8.zip
* configure.in (RUBY_CHECK_HUGE): checks whether a value range is
larger than long. * file.c (rb_stat_blocks): struct stat.st_blocks may be larger than long. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/file.c b/file.c
index 860aff056..d30a2c669 100644
--- a/file.c
+++ b/file.c
@@ -502,8 +502,12 @@ rb_stat_blksize(VALUE self)
static VALUE
rb_stat_blocks(VALUE self)
{
-#ifdef HAVE_ST_BLOCKS
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
+# ifdef HUGE_STRUCT_STAT_ST_BLOCKS
+ return ULL2NUM(get_stat(self)->st_blocks);
+# else
return ULONG2NUM(get_stat(self)->st_blocks);
+# endif
#else
return Qnil;
#endif