Hello all,

Observe: Two nearly identical Ruby programs.
One says "fork do" and the other says "if not fork"
(shouldn't that work?).

The block form works. The other one gives an error
from Process.wait (but seems to work anyway).

Interestingly, it behaves the same way on Win98 and
Solaris. Hey, even the bugs are cross-platform!

What's going on?

Thanks,
Hal



C:>type e1.rb
puts "hi"
if not fork
  puts "I'm the child"
  sleep 2
end
Process.wait
puts "Parent again"

C:>type e2.rb
puts "hi"
fork do
  puts "I'm the child"
  sleep 2
end
Process.wait
puts "Parent again"

C:>ruby e1.rb
hi
I'm the child
e1.rb:6:in `wait': No children (Errno::ECHILD)
        from e1.rb:6
Parent again

C:>ruby e2.rb
hi
I'm the child
Parent again