file.c: proper types

* file.c (rb_file_chown): use proper configured types, not plain
  int.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-12-25 00:47:26 +00:00
parent 15381aa203
commit 4db0887d67

7
file.c
View File

@ -2292,14 +2292,15 @@ static VALUE
rb_file_chown(VALUE obj, VALUE owner, VALUE group) rb_file_chown(VALUE obj, VALUE owner, VALUE group)
{ {
rb_io_t *fptr; rb_io_t *fptr;
int o, g; rb_uid_t o;
rb_gid_t g;
#ifndef HAVE_FCHOWN #ifndef HAVE_FCHOWN
VALUE path; VALUE path;
#endif #endif
rb_secure(2); rb_secure(2);
o = NIL_P(owner) ? -1 : NUM2INT(owner); o = NIL_P(owner) ? (rb_uid_t)-1 : NUM2UIDT(owner);
g = NIL_P(group) ? -1 : NUM2INT(group); g = NIL_P(group) ? (rb_gid_t)-1 : NUM2GIDT(group);
GetOpenFile(obj, fptr); GetOpenFile(obj, fptr);
#ifndef HAVE_FCHOWN #ifndef HAVE_FCHOWN
if (NIL_P(fptr->pathv)) return Qnil; if (NIL_P(fptr->pathv)) return Qnil;