summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--process.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4432e1d3b0..609ab87068 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Mar 8 23:49:45 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (proc_setgroups): cleanup.
+
Tue Mar 8 23:40:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/misc/test_ruby_mode.rb: test for ruby-mode.el.
diff --git a/process.c b/process.c
index 08a0258c13..559fe1d838 100644
--- a/process.c
+++ b/process.c
@@ -4639,10 +4639,10 @@ proc_setgroups(VALUE obj, VALUE ary)
Check_Type(ary, T_ARRAY);
- if (RARRAY_LEN(ary) > maxgroups())
+ ngroups = RARRAY_LENINT(ary);
+ if (ngroups > maxgroups())
rb_raise(rb_eArgError, "too many groups, %d max", maxgroups());
- ngroups = RARRAY_LENINT(ary);
groups = ALLOCA_N(rb_gid_t, ngroups);
for (i = 0; i < ngroups; i++) {