зеркало из https://github.com/github/ruby.git
* process.c (proc_getgroups): get rid of maxgroups dependency.
ngroups can be calculated dynamically. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b1329e3b63
Коммит
c6bb8beb52
|
@ -1,3 +1,8 @@
|
|||
Mon Mar 7 00:21:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* process.c (proc_getgroups): get rid of maxgroups dependency.
|
||||
ngroups can be calculated dynamically.
|
||||
|
||||
Sun Mar 6 23:45:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* configure.in: rlim_t use standard RUBY_REPLACE_TYPE mechanism.
|
||||
|
|
|
@ -4563,9 +4563,13 @@ proc_getgroups(VALUE obj)
|
|||
int i, ngroups;
|
||||
rb_gid_t *groups;
|
||||
|
||||
groups = ALLOCA_N(rb_gid_t, maxgroups);
|
||||
ngroups = getgroups(0, NULL);
|
||||
if (ngroups == -1)
|
||||
rb_sys_fail(0);
|
||||
|
||||
ngroups = getgroups(maxgroups, groups);
|
||||
groups = ALLOCA_N(rb_gid_t, ngroups);
|
||||
|
||||
ngroups = getgroups(ngroups, groups);
|
||||
if (ngroups == -1)
|
||||
rb_sys_fail(0);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче