Bug #1287: $? not set after Open3::popen3
http://redmine.ruby-lang.org/issues/show/1287

Author: Heesob Park
Status: Open, Priority: Normal
Target version: 1.9.1
ruby -v: ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]

$? is not set after popen3 in 1.9.1

Try following code:

require 'open3'
status = Open3::popen3("echo hello") do |stdin,stdout,stderr|
    stdout.each { |line| puts "stdout:"+line }
end
p $?

[sidns@ns ~]$ ruby -v po.rb
ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-linux]
stdout:hello
#<Process::Status: pid=20140,exited(0)>

[siweb@localhost ~]$ ruby -v po.rb
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
stdout:hello
nil


----------------------------------------
http://redmine.ruby-lang.org