From b5d60c37a9649ae7dd932fcece7c77109cce0d81 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 11 Mar 2012 10:25:49 -0400 Subject: 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 --- lib/systemu.rb | 7 +++++-- 1 file 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 ] -- cgit v1.2.1