Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change extract pgroup value

Cases:
1. pgroup value is 'true' => 0
2. pgroup value is kind of true => Rubinius will try coerce_to Integer
3. pgroup value if kind of true and pass coerce then Rubinius will check
check whether the value is < 0. If yes then an ArgumentError exception is thrown
4. pgroup if kind of false (false, nil) - default behavior (like without
pgroup)

Fixes #1894
  • Loading branch information...
commit 848849dfafab9167dbfa142e40743f645b9eec48 1 parent cdc63e1
@LTe authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 kernel/common/process19.rb
View
7 kernel/common/process19.rb
@@ -73,7 +73,12 @@ def self.adjust_options(options)
when :in, :out, :err, Fixnum, IO
redirects[key] = adjust_redirect_value(key, value)
when :pgroup
- raise ArgumentError, "negative process group ID : #{value}" if value && value < 0
+ if value == true
+ value = 0
+ elsif value
+ value = Rubinius::Type.coerce_to value, Integer, :to_int
+ raise ArgumentError, "negative process group ID : #{value}" if value < 0
+ end
others[key] = value
when :chdir
others[key] = Rubinius::Type.coerce_to_path(value)
Please sign in to comment.
Something went wrong with that request. Please try again.