Skip to content

Commit

Permalink
Ensuring exit status is always set, even when $? isn't
Browse files Browse the repository at this point in the history
  • Loading branch information
bitgangsta committed Dec 17, 2013
1 parent 20c0469 commit dfc2972
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cocaine/command_line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def run(interpolations = {})
rescue Errno::ENOENT => e
raise Cocaine::CommandNotFoundError, e.message
ensure
@exit_status = $?.exitstatus if $?.respond_to?(:exitstatus)
@exit_status = $?.respond_to?(:exitstatus) ? $?.exitstatus : 0
end
if @exit_status == 127
raise Cocaine::CommandNotFoundError
Expand Down

0 comments on commit dfc2972

Please sign in to comment.