diff --git a/ChangeLog b/ChangeLog index 42196547a2..1f39208cf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 11 10:09:18 2013 NARUSE, Yui + + * process.c (rb_daemon): daemon(3) is implemented with fork(2). + Therefore it needs rb_thread_atfork(). (and revert r41903) + Thu Jul 11 03:22:10 2013 Aaron Patterson * tool/probes_to_wiki.rb: adding a script to convert probes.d to wiki diff --git a/process.c b/process.c index 0f62252cca..7ea74ca2fd 100644 --- a/process.c +++ b/process.c @@ -5736,6 +5736,7 @@ rb_daemon(int nochdir, int noclose) before_fork(); err = daemon(nochdir, noclose); after_fork(); + rb_thread_atfork(); #else int n; diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 226e348156..058494385d 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1492,18 +1492,6 @@ class TestProcess < Test::Unit::TestCase assert_equal(2, data.size, bug4920) assert_not_include(data.map(&:to_i), pid) end - elsif /freebsd/ =~ RUBY_PLATFORM - def test_daemon_no_threads - data = Timeout.timeout(3) do - IO.popen("-") do |f| - break f.readlines.map(&:chomp) if f - th = Thread.start {sleep 3} - Process.daemon(true, true) - puts Thread.list.size, th.status.inspect - end - end - assert_equal(["2", "\"run\""], data) - end else # darwin def test_daemon_no_threads data = Timeout.timeout(3) do