file.c: use correct integer-conversion function

The return value of major() and minor() is unsigned int, not dev_t.
So, UINT2NUM() is a better choice than DEVT2NUM().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2018-10-23 12:23:04 +00:00
Родитель fd35cb44b8
Коммит dc2e3f1ecf
1 изменённых файлов: 4 добавлений и 4 удалений

8
file.c
Просмотреть файл

@ -572,7 +572,7 @@ static VALUE
rb_stat_dev_major(VALUE self)
{
#if defined(major)
return DEVT2NUM(major(get_stat(self)->st_dev));
return UINT2NUM(major(get_stat(self)->st_dev));
#else
return Qnil;
#endif
@ -593,7 +593,7 @@ static VALUE
rb_stat_dev_minor(VALUE self)
{
#if defined(minor)
return DEVT2NUM(minor(get_stat(self)->st_dev));
return UINT2NUM(minor(get_stat(self)->st_dev));
#else
return Qnil;
#endif
@ -731,7 +731,7 @@ static VALUE
rb_stat_rdev_major(VALUE self)
{
#if defined(HAVE_STRUCT_STAT_ST_RDEV) && defined(major)
return DEVT2NUM(major(get_stat(self)->st_rdev));
return UINT2NUM(major(get_stat(self)->st_rdev));
#else
return Qnil;
#endif
@ -752,7 +752,7 @@ static VALUE
rb_stat_rdev_minor(VALUE self)
{
#if defined(HAVE_STRUCT_STAT_ST_RDEV) && defined(minor)
return DEVT2NUM(minor(get_stat(self)->st_rdev));
return UINT2NUM(minor(get_stat(self)->st_rdev));
#else
return Qnil;
#endif