Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: rainbows-public@bogomips.org
Subject: [PATCH 3/6] t/close-has-env.ru: ensure close is idempotent
Date: Mon, 14 Sep 2015 05:33:15 +0000	[thread overview]
Message-ID: <20150914053318.12251-4-e@80x24.org> (raw)
In-Reply-To: <20150914053318.12251-1-e@80x24.org>

Ruby 2.3.0 will have idempotent IO#close, so closing an IO
twice will be idempotent and not raise an IOError exception.
Ensure we do not rely on the IOError exception to catch
our own errors.
 t/close-has-env.ru | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/close-has-env.ru b/t/close-has-env.ru
index 471f605..3b6ec88 100644
--- a/t/close-has-env.ru
+++ b/t/close-has-env.ru
@@ -10,6 +10,7 @@ class ClosablePipe < ::IO
   def close
+    return if closed? # idempotent for Ruby 2.3.0 compatibility
     $stdout.syswrite "path_info=#{@env['PATH_INFO']}\n"

  parent reply	other threads:[~2015-09-14  5:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14  5:33 [PATCH 0/6] misc updates for Ruby-trunk and gem changes Eric Wong
2015-09-14  5:33 ` [PATCH 1/6] build: fix quoting issue with double parens Eric Wong
2015-09-14  5:33 ` [PATCH 2/6] response: avoid unnecessary args to IO.copy_stream Eric Wong
2015-09-14  5:33 ` Eric Wong [this message]
2015-09-14  5:33 ` [PATCH 4/6] sync_close: This fix breakage from Ruby-trunk r50118 Eric Wong
2015-09-14  5:33 ` [PATCH 5/6] t/t0044-autopush.sh: remove test Eric Wong
2016-12-24 22:04   ` Eric Wong
2015-09-14  5:33 ` [PATCH 6/6] t/test_isolate.rb: updates for various gem versions Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150914053318.12251-4-e@80x24.org \
    --to=e@80x24.org \
    --cc=rainbows-public@bogomips.org \
    --subject='Re: [PATCH 3/6] t/close-has-env.ru: ensure close is idempotent' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Rainbows! Rack HTTP server user/dev discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhbt.net/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 rainbows-public rainbows-public/ https://yhbt.net/rainbows-public \
		rainbows-public@yhbt.net rainbows-public@bogomips.org rainbows-talk@rubyforge.org rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
	public-inbox-index rainbows-public

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:


AGPL code for this site: git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/public-inbox.git