about summary refs log tree commit homepage
path: root/lib/dtas/spawn_fix.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-01-19 09:17:51 +0000
committerEric Wong <e@80x24.org>2015-01-19 09:58:47 +0000
commitef39866fa6e6ac91cc64f18573dea22c3f75c6e1 (patch)
tree62ab8b9cfdf57acf63b84661f7ed8fa1725b9fc8 /lib/dtas/spawn_fix.rb
parentb95a51440b6378847c4ab5dd4cf9e96e18b5f241 (diff)
downloaddtas-ef39866fa6e6ac91cc64f18573dea22c3f75c6e1.tar.gz
Ensure we can apply the workaround to dtas-sourceedit and our
test cases while also simplifying the existing call sites a
little.  This will also make for less code churn in 3-5
years down the line when we drop <= 2.1 support.
Diffstat (limited to 'lib/dtas/spawn_fix.rb')
-rw-r--r--lib/dtas/spawn_fix.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/dtas/spawn_fix.rb b/lib/dtas/spawn_fix.rb
new file mode 100644
index 0000000..dfcc884
--- /dev/null
+++ b/lib/dtas/spawn_fix.rb
@@ -0,0 +1,8 @@
+module DTAS::SpawnFix # :nodoc:
+  # workaround for older Rubies: https://bugs.ruby-lang.org/issues/8770
+  def spawn(*args)
+    super(*args)
+  rescue Errno::EINTR
+    retry
+  end if RUBY_VERSION.to_f <= 2.1
+end