From 52b40be04b961a38379d559b3a10d8a6252ba43b Mon Sep 17 00:00:00 2001 From: kosaki Date: Mon, 7 Mar 2011 12:54:27 +0000 Subject: small cleanup. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/process.c b/process.c index 134ebfac5c..1750234bdd 100644 --- a/process.c +++ b/process.c @@ -4612,7 +4612,7 @@ proc_getgroups(VALUE obj) static VALUE proc_setgroups(VALUE obj, VALUE ary) { - size_t ngroups, i; + int ngroups, i; rb_gid_t *groups; long getgr_buf_len = sysconf(_SC_GETGR_R_SIZE_MAX); char* getgr_buf; @@ -4623,13 +4623,13 @@ proc_setgroups(VALUE obj, VALUE ary) Check_Type(ary, T_ARRAY); - ngroups = RARRAY_LEN(ary); - if (ngroups > (size_t)maxgroups()) - rb_raise(rb_eArgError, "too many groups, %u max", maxgroups()); + if (RARRAY_LEN(ary) > maxgroups()) + rb_raise(rb_eArgError, "too many groups, %d max", maxgroups()); + ngroups = RARRAY_LEN(ary); groups = ALLOCA_N(rb_gid_t, ngroups); - for (i = 0; i < ngroups && i < (size_t)RARRAY_LEN(ary); i++) { + for (i = 0; i < ngroups; i++) { VALUE g = RARRAY_PTR(ary)[i]; if (FIXNUM_P(g)) { @@ -4659,7 +4659,7 @@ proc_setgroups(VALUE obj, VALUE ary) } } - if (setgroups((int)ngroups, groups) == -1) /* ngroups <= maxgroups */ + if (setgroups(ngroups, groups) == -1) /* ngroups <= maxgroups */ rb_sys_fail(0); return proc_getgroups(obj); -- cgit v1.2.3