Project

General

Profile

Actions

Bug #4467

closed

Process.maxgroups= should only accept numeric values

Added by djberg96 (Daniel Berger) about 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
-
[ruby-core:35426]

Description

=begin
At the moment Process.maxgroups= accepts non-numeric values, which results in defaulting to 4096. IMO it should raise a TypeError.

diff --git a/process.orig b/process.c
index f658fa9..c3c4a1f 100644
--- a/process.orig
+++ b/process.c
@@ -2752,7 +2752,7 @@ proc_getmaxgroups(obj)
static VALUE
proc_setmaxgroups(VALUE obj, VALUE val)
{

  • size_t ngroups = FIX2INT(val);
  • size_t ngroups = NUM2INT(val);

    if (ngroups > 4096)
    ngroups = 4096;
    =end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0