summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Horner <gabriel.horner@gmail.com>2012-03-11 10:25:49 -0400
committerGabriel Horner <gabriel.horner@gmail.com>2012-03-11 10:25:49 -0400
commitb5d60c37a9649ae7dd932fcece7c77109cce0d81 (patch)
tree88f21726af2545dd6ce29461e8d0221575ad001a
parent5181b8a71605315fd74785d0a4be5e1040195e84 (diff)
downloadsystemu-b5d60c37a9649ae7dd932fcece7c77109cce0d81.tar.gz
pass pid to RubyProcess::RubyStatus.new_process_status
* this method call is missing a third argument, pid * this fix at least works on unix based systems * closes #9
-rw-r--r--lib/systemu.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/systemu.rb b/lib/systemu.rb
index 9252450..e29131b 100644
--- a/lib/systemu.rb
+++ b/lib/systemu.rb
@@ -173,7 +173,7 @@ class SystemUniversal
def child_program config
<<-program
# encoding: utf-8
-
+
PIPE = STDOUT.dup
begin
config = Marshal.load(IO.read('#{ config }'))
@@ -274,8 +274,11 @@ if defined? JRUBY_VERSION
end
exit_code = process.wait_for
+ field = process.get_class.get_declared_field("pid")
+ field.set_accessible(true)
+ pid = field.get(process)
[
- RubyProcess::RubyStatus.new_process_status(JRuby.runtime, exit_code),
+ RubyProcess::RubyStatus.new_process_status(JRuby.runtime, exit_code, pid),
stdout.join,
stderr.join
]