From dfc2972926a507ad3351ba3ac936142638a6f084 Mon Sep 17 00:00:00 2001 From: Daniel Jabbour Date: Mon, 16 Dec 2013 21:06:28 -0800 Subject: [PATCH] Ensuring exit status is always set, even when $? isn't --- lib/cocaine/command_line.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cocaine/command_line.rb b/lib/cocaine/command_line.rb index 92393f9..5b53dea 100644 --- a/lib/cocaine/command_line.rb +++ b/lib/cocaine/command_line.rb @@ -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