8000 file.c: proper types · eagletmt/ruby@4db0887 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4db0887

Browse files
committed
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
1 parent 15381aa commit 4db0887

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

file.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,14 +2292,15 @@ static VALUE
22922292
rb_file_chown(VALUE obj, VALUE owner, VALUE group)
22932293
{
22942294
rb_io_t *fptr;
2295-
int o, g;
2295+
rb_uid_t o;
2296+
rb_gid_t g;
22962297
#ifndef HAVE_FCHOWN
22972298
VALUE path;
22982299
#endif
22992300

23002301
rb_secure(2);
2301-
o = NIL_P(owner) ? -1 : NUM2INT(owner);
2302-
g = NIL_P(group) ? -1 : NUM2INT(group);
2302+
o = NIL_P(owner) ? (rb_uid_t)-1 : NUM2UIDT(owner);
2303+
g = NIL_P(group) ? (rb_gid_t)-1 : NUM2GIDT(group);
23032304
GetOpenFile(obj, fptr);
23042305
#ifndef HAVE_FCHOWN
23052306
if (NIL_P(fptr->pathv)) return Qnil;

0 commit comments

Comments
 (0)
0