зеркало из https://github.com/github/ruby.git
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:
Родитель
fd35cb44b8
Коммит
dc2e3f1ecf
8
file.c
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче