about summary refs log tree commit homepage
path: root/lib/dtas/partstats.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-01-19 09:04:18 +0000
committerEric Wong <e@80x24.org>2015-01-19 09:58:47 +0000
commitb95a51440b6378847c4ab5dd4cf9e96e18b5f241 (patch)
treec9266398424220484c9f9c2b4969c9908abc5b89 /lib/dtas/partstats.rb
parent723cd6da883bda87e092707ce17c31190a1c5205 (diff)
downloaddtas-b95a51440b6378847c4ab5dd4cf9e96e18b5f241.tar.gz
This makes debugging, grepping, and following code confusing
at times and also unexpected breaks usage of the global "spawn"
method.
Diffstat (limited to 'lib/dtas/partstats.rb')
-rw-r--r--lib/dtas/partstats.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/dtas/partstats.rb b/lib/dtas/partstats.rb
index 76e4940..6c714b3 100644
--- a/lib/dtas/partstats.rb
+++ b/lib/dtas/partstats.rb
@@ -49,7 +49,7 @@ class DTAS::PartStats
     rv
   end
 
-  def spawn(trim_part, opts)
+  def partstats_spawn(trim_part, opts)
     rd, wr = IO.pipe
     env = opts[:env]
     env = env ? env.dup : {}
@@ -58,7 +58,8 @@ class DTAS::PartStats
     opts = { pgroup: true, close_others: true, err: wr }
     pid = begin
       Process.spawn(env, CMD, opts)
-    rescue Errno::EINTR # Ruby bug?
+    rescue Errno::EINTR
+      # workaround for older Rubies https://bugs.ruby-lang.org/issues/8770
       retry
     end
     wr.close
@@ -74,7 +75,7 @@ class DTAS::PartStats
     stats = []
     fails = []
     do_spawn = lambda do |trim_part|
-      pid, rpipe = spawn(trim_part, opts)
+      pid, rpipe = partstats_spawn(trim_part, opts)
       rset[rpipe] = [ trim_part, "" ]
       pids[pid] = [ trim_part, rpipe ]
     end