lib/ztk/command.rb in ztk-0.2.6 vs lib/ztk/command.rb in ztk-0.2.7
- old
+ new
@@ -153,19 +153,14 @@
direct_log(:debug) { log_header("TIMEOUT") }
log_and_raise(CommandError, "Process timed out after #{config.timeout} seconds!")
end
Process.waitpid(pid)
+ exit_code = $?.exitstatus
direct_log(:debug) { log_header("STOPPED") }
parent_stdout_reader.close
parent_stderr_reader.close
-
- if RUBY_VERSION >= "1.9"
- exit_code = $?.exitstatus
- else
- exit_code = $?
- end
config.logger.debug { "exit_code(#{exit_code})" }
if !config.ignore_exit_status && (exit_code != options.exit_code)
log_and_raise(CommandError, "exec(#{command.inspect}, #{options.inspect}) failed! [#{exit_code}]")