1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* process.c (maxgroups): cast because sysconf(3)'s return value is long.

* process.c (proc_setmaxgroups): ditto.

* process.c (proc_setgroups): cast because RARRAY_LEN() is long.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2011-03-07 16:13:57 +00:00
parent 30c06ec68a
commit fe8e2dd1e1
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,11 @@
Tue Mar 8 01:11:44 2011 NARUSE, Yui <naruse@ruby-lang.org>
* process.c (maxgroups): cast because sysconf(3)'s return value is long.
* process.c (proc_setmaxgroups): ditto.
* process.c (proc_setgroups): cast because RARRAY_LEN() is long.
Tue Mar 8 00:02:47 2011 Tanaka Akira <akr@fsij.org>
* ext/openssl/ossl_pkey_rsa.c: parenthesize macro arguments.

View file

@ -4545,7 +4545,7 @@ static int _maxgroups = -1;
static int maxgroups(void)
{
if (_maxgroups < 0) {
_maxgroups = sysconf(_SC_NGROUPS_MAX);
_maxgroups = (int)sysconf(_SC_NGROUPS_MAX);
if (_maxgroups < 0)
_maxgroups = RB_MAX_GROUPS;
}
@ -4626,7 +4626,7 @@ proc_setgroups(VALUE obj, VALUE ary)
if (RARRAY_LEN(ary) > maxgroups())
rb_raise(rb_eArgError, "too many groups, %d max", maxgroups());
ngroups = RARRAY_LEN(ary);
ngroups = (int)RARRAY_LEN(ary);
groups = ALLOCA_N(rb_gid_t, ngroups);
for (i = 0; i < ngroups; i++) {
@ -4729,7 +4729,7 @@ static VALUE
proc_setmaxgroups(VALUE obj, VALUE val)
{
int ngroups = FIX2INT(val);
int ngroups_max = sysconf(_SC_NGROUPS_MAX);
int ngroups_max = (int)sysconf(_SC_NGROUPS_MAX);
if (ngroups <= 0)
rb_raise(rb_eArgError, "maxgroups %d shold be positive", ngroups);