From 43f17a976580c514b3687e45faf00a7d1978786f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Kolsjo=CC=88?= Date: Fri, 27 Apr 2012 22:25:11 +0200 Subject: [PATCH] Catching exit status in the right place so that it works. --- lib/runner/job.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/runner/job.rb b/lib/runner/job.rb index 8b3def8..d66a226 100644 --- a/lib/runner/job.rb +++ b/lib/runner/job.rb @@ -9,6 +9,7 @@ class Job def initialize(runner, id, build_id, project, root, type, ruby_interpreter, files) @runner, @id, @build_id, @project, @root, @type, @ruby_interpreter, @files = runner, id, build_id, project, root, type, ruby_interpreter, files + @success = true end def jruby? @@ -84,7 +85,8 @@ def spawn_process(command) @pid = POSIX::Spawn::spawn(command, :err => write_pipe, :out => write_pipe, :pgroup => true) Thread.new do - Process.wait(@pid) + Process.waitpid(@pid) + @success = ($?.exitstatus == 0) write_pipe.close end @@ -92,7 +94,7 @@ def spawn_process(command) end def success? - $?.exitstatus == 0 + @success end def ruby_cmd