diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-23 04:31:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-23 04:31:09 +0000 |
commit | c5fef27312bdf014eaf408ec488d03b7fad5a9d3 (patch) | |
tree | 5ce6f9ce415a80898caf6cceb217da3a27fc4306 /file.c | |
parent | 3254b0f3c1c34119949839e855420defbac03d85 (diff) | |
download | ruby-c5fef27312bdf014eaf408ec488d03b7fad5a9d3.tar.gz |
file.c: unpack in binary
* file.c (statfs_fsid): convert with rb_integer_unpack.
* configure.in: fsid_t is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -5540,16 +5540,9 @@ 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 + return rb_integer_unpack(&get_statfs(self)->f_fsid, + 1, sizeof(get_statfs(self)->f_fsid), + 0, INTEGER_PACK_2COMP|INTEGER_PACK_NATIVE_BYTE_ORDER); } #ifdef HAVE_STRUCT_STATFS_F_FSTYPENAME |