[前][次][番号順一覧][スレッド一覧]

ruby-changes:32321

From: nobu <ko1@a...>
Date: Wed, 25 Dec 2013 09:47:31 +0900 (JST)
Subject: [ruby-changes:32321] nobu:r44400 (trunk): file.c: proper types

nobu	2013-12-25 09:47:26 +0900 (Wed, 25 Dec 2013)

  New Revision: 44400

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44400

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

  Modified files:
    trunk/file.c
Index: file.c
===================================================================
--- file.c	(revision 44399)
+++ file.c	(revision 44400)
@@ -2292,14 +2292,15 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/file.c#L2292
 rb_file_chown(VALUE obj, VALUE owner, VALUE group)
 {
     rb_io_t *fptr;
-    int o, g;
+    rb_uid_t o;
+    rb_gid_t g;
 #ifndef HAVE_FCHOWN
     VALUE path;
 #endif
 
     rb_secure(2);
-    o = NIL_P(owner) ? -1 : NUM2INT(owner);
-    g = NIL_P(group) ? -1 : NUM2INT(group);
+    o = NIL_P(owner) ? (rb_uid_t)-1 : NUM2UIDT(owner);
+    g = NIL_P(group) ? (rb_gid_t)-1 : NUM2GIDT(group);
     GetOpenFile(obj, fptr);
 #ifndef HAVE_FCHOWN
     if (NIL_P(fptr->pathv)) return Qnil;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]