Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Commit

Permalink
Catching exit status in the right place so that it works.
Browse files Browse the repository at this point in the history
  • Loading branch information
joakimk committed Apr 27, 2012
1 parent eca76b0 commit 43f17a9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/runner/job.rb
Expand Up @@ -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?
Expand Down Expand Up @@ -84,15 +85,16 @@ 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

read_pipe
end

def success?
$?.exitstatus == 0
@success
end

def ruby_cmd
Expand Down

0 comments on commit 43f17a9

Please sign in to comment.