$OpenBSD$ --- bootstraptest/test_thread.rb.orig Wed Jul 27 13:02:36 2011 +++ bootstraptest/test_thread.rb Wed Jul 27 16:38:28 2011 @@ -49,11 +49,13 @@ assert_equal %q{5000}, %q{ end } } +unless /openbsd/ =~ RUBY_PLATFORM assert_equal %q{100}, %q{ 100.times{ Thread.new{loop{Thread.pass}} } } +end assert_equal %q{ok}, %q{ Thread.new{ :ok $OpenBSD$ --- common.mk.orig Wed Jul 27 14:12:43 2011 +++ common.mk Wed Jul 27 14:12:54 2011 @@ -8,7 +8,7 @@ dll: $(LIBRUBY_SO) V = 0 Q1 = $(V:1=) Q = $(Q1:0=@) -ECHO1 = $(V:1=@:) +ECHO1 = $(V:1=@) ECHO = $(ECHO1:0=@echo) RUBYLIB = - $OpenBSD$ --- configure.in.orig Wed Jul 27 13:02:36 2011 +++ configure.in Wed Jul 27 13:31:05 2011 @@ -1817,7 +1817,9 @@ if test x"$enable_pthread" = xyes; then [c], [], [root], [], [c_r], [MAINLIBS="-pthread $MAINLIBS"], - [LIBS="-l$pthread_lib $LIBS"]) + [AS_CASE(["$target_os"], + [openbsd*], [LIBS="-pthread $LIBS"], + [LIBS="-l$pthread_lib $LIBS"])]) else AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled") fi $OpenBSD$ --- enc/Makefile.in.orig Wed Jul 27 14:18:51 2011 +++ enc/Makefile.in Wed Jul 27 14:18:59 2011 @@ -1,7 +1,7 @@ V = 0 Q1 = $(V:1=) Q = $(Q1:0=@) -ECHO1 = $(V:1=@:) +ECHO1 = $(V:1=@) ECHO = $(ECHO1:0=@echo) encsrcdir = @srcdir@ $OpenBSD$ --- ext/extmk.rb.orig Wed Jul 27 14:24:46 2011 +++ ext/extmk.rb Wed Jul 27 14:25:21 2011 @@ -595,7 +595,7 @@ if $configure_only and $command_output mf.puts "V = 0" mf.puts "Q1 = $(V:1=)" mf.puts "Q = $(Q1:0=@)" - mf.puts "ECHO1 = $(V:1=@:)" + mf.puts "ECHO1 = $(V:1=@)" mf.puts "ECHO = $(ECHO1:0=@echo)" mf.puts "MFLAGS = -$(MAKEFLAGS)" if $nmake mf.puts $OpenBSD$ --- ext/socket/lib/socket.rb.orig Wed Jul 27 16:22:00 2011 +++ ext/socket/lib/socket.rb Wed Jul 27 16:32:37 2011 @@ -513,7 +513,7 @@ class Socket < BasicSocket next if !a.ipv4? ip_list << Addrinfo.new(a.to_sockaddr, :INET, :DGRAM, 0); } - elsif ai.ipv6? && ai.ip_address == "::" && !ipv6_recvpktinfo + elsif ai.ipv6? && ai.ip_address == "::" local_addrs.each {|a| next if !a.ipv6? ip_list << Addrinfo.new(a.to_sockaddr, :INET6, :DGRAM, 0); @@ -541,12 +541,10 @@ class Socket < BasicSocket end end - pktinfo_sockets = {} sockets.each {|s| ai = s.local_address if ipv6_recvpktinfo && ai.ipv6? && ai.ip_address == "::" s.setsockopt(:IPV6, ipv6_recvpktinfo, 1) - pktinfo_sockets[s] = true end } $OpenBSD$ --- lib/mkmf.rb.orig Wed Jul 27 14:25:05 2011 +++ lib/mkmf.rb Wed Jul 27 14:25:40 2011 @@ -1640,7 +1640,7 @@ SHELL = /bin/sh V = 0 Q1 = $(V:1=) Q = $(Q1:0=@) -ECHO1 = $(V:1=@:) +ECHO1 = $(V:1=@) ECHO = $(ECHO1:0=@echo) #### Start of system configuration section. #### $OpenBSD$ --- lib/test/unit.rb.orig Wed Jul 27 15:21:54 2011 +++ lib/test/unit.rb Wed Jul 27 16:04:54 2011 @@ -493,19 +493,23 @@ module Test end end end - @workers.each do |worker| - begin - timeout(1) do - worker.puts "quit" + if @workers + @workers.each do |worker| + begin + timeout(1) do + worker.puts "quit" + end + rescue Errno::EPIPE + rescue Timeout::Error end - rescue Errno::EPIPE - rescue Timeout::Error + worker.close end - worker.close end begin - timeout(0.2*@workers.size) do - Process.waitall + if @workers + timeout(0.2*@workers.size) do + Process.waitall + end end rescue Timeout::Error @workers.each do |worker| $OpenBSD$ --- signal.c.orig Wed Jul 27 16:36:43 2011 +++ signal.c Wed Jul 27 16:37:16 2011 @@ -438,8 +438,8 @@ rb_register_sigaltstack(rb_thread_t *th) newSS.ss_sp = th->altstack = malloc(ALT_STACK_SIZE); if (newSS.ss_sp == NULL) - /* should handle error */ - rb_bug("rb_register_sigaltstack. malloc error\n"); + return; + newSS.ss_size = ALT_STACK_SIZE; newSS.ss_flags = 0; $OpenBSD$ --- test/rake/helper.rb.orig Wed Jul 27 15:48:14 2011 +++ test/rake/helper.rb Wed Jul 27 15:48:16 2011 @@ -455,35 +455,35 @@ end rakefile <<-VERBOSE task :standalone_verbose_true do verbose true - sh "ruby -e '0'" + sh "#{RUBY} -e '0'" end task :standalone_verbose_false do verbose false - sh "ruby -e '0'" + sh "#{RUBY} -e '0'" end task :inline_verbose_default do - sh "ruby -e '0'" + sh "#{RUBY} -e '0'" end task :inline_verbose_false do - sh "ruby -e '0'", :verbose => false + sh "#{RUBY} -e '0'", :verbose => false end task :inline_verbose_true do - sh "ruby -e '0'", :verbose => true + sh "#{RUBY} -e '0'", :verbose => true end task :block_verbose_true do verbose(true) do - sh "ruby -e '0'" + sh "#{RUBY} -e '0'" end end task :block_verbose_false do verbose(false) do - sh "ruby -e '0'" + sh "#{RUBY} -e '0'" end end VERBOSE $OpenBSD$ --- test/rake/test_rake_functional.rb.orig Wed Jul 27 15:49:14 2011 +++ test/rake/test_rake_functional.rb Wed Jul 27 15:49:18 2011 @@ -174,7 +174,7 @@ class TestRakeFunctional < Rake::TestCase rake "inline_verbose_default" - assert_match(/ruby -e/, @err) + assert_match(/#{RUBY} -e/, @err) end def test_inline_verbose_true_should_show_command @@ -182,7 +182,7 @@ class TestRakeFunctional < Rake::TestCase rake "inline_verbose_true" - assert_match(/ruby -e/, @err) + assert_match(/#{RUBY} -e/, @err) end def test_inline_verbose_false_should_not_show_command @@ -190,7 +190,7 @@ class TestRakeFunctional < Rake::TestCase rake "inline_verbose_false" - refute_match(/ruby -e/, @err) + refute_match(/#{RUBY} -e/, @err) end def test_block_verbose_false_should_not_show_command @@ -198,7 +198,7 @@ class TestRakeFunctional < Rake::TestCase rake "block_verbose_false" - refute_match(/ruby -e/, @err) + refute_match(/#{RUBY} -e/, @err) end def test_block_verbose_true_should_show_command @@ -206,7 +206,7 @@ class TestRakeFunctional < Rake::TestCase rake "block_verbose_true" - assert_match(/ruby -e/, @err) + assert_match(/#{RUBY} -e/, @err) end def test_standalone_verbose_true_should_show_command @@ -214,7 +214,7 @@ class TestRakeFunctional < Rake::TestCase rake "standalone_verbose_true" - assert_match(/ruby -e/, @err) + assert_match(/#{RUBY} -e/, @err) end def test_standalone_verbose_false_should_not_show_command @@ -222,7 +222,7 @@ class TestRakeFunctional < Rake::TestCase rake "standalone_verbose_false" - refute_match(/ruby -e/, @err) + refute_match(/#{RUBY} -e/, @err) end def test_dry_run $OpenBSD$ --- test/ruby/test_process.rb.orig Wed Jul 27 17:16:58 2011 +++ test/ruby/test_process.rb Wed Jul 27 17:17:00 2011 @@ -61,7 +61,7 @@ class TestProcess < Test::Unit::TestCase write_file 's', <<-"End" result = 1 begin - Process.setrlimit(Process::RLIMIT_NOFILE, 0) + Process.setrlimit(Process::RLIMIT_NOFILE, 1) rescue Errno::EINVAL result = 0 end