Issue #1287 has been updated by Akira Tanaka.

Status changed from Open to Rejected

ruby 1.8 don't have a way to know the exit status because double fork is used.

$? doesn't reflect the actual status.

% ruby-1.8.6p287 -ropen3 -ve '
status = Open3::popen3("echo hello;exit 1") do |stdin,stdout,stderr|
   stdout.each { |line| puts "stdout:"+line }
end
p $?'
ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux]
stdout:hello
#<Process::Status: pid=31667,exited(0)>

open3 in ruby 1.9 has the fourth argument, wait thread, to the block.
The thread wait the child process and returns the exit status as the value of the thread.

% ruby-1.9.1p0 -ropen3 -ve '
status = Open3::popen3("echo hello;exit 1") do |stdin,stdout,stderr,waitth|
   stdout.each { |line| puts "stdout:"+line }
   p waitth.value
end
'
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
stdout:hello
#<Process::Status: pid 31847 exit 1>

----------------------------------------
http://redmine.ruby-lang.org/issues/show/1287

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