summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-08-28 18:52:48 +0000
committerEric Wong <normalperson@yhbt.net>2010-08-28 19:16:50 +0000
commitca8ed32c8cc990c7e64b6bd7168808a83405a5a5 (patch)
treecc243811b1dc68edc2fd555f83e762d37f7ecc60
parent27f4d6ed7c7758620b54deccae319ba7aa9d40eb (diff)
A follow-up to 4b23693b9082a84433a9e6c1f358b58420176b27

If multithreaded programming can be compared to juggling
chainsaws, then multithreaded programming with signal handlers
in play is akin to juggling chainsaws on a tightrope
over shark-infested waters.
(cherry picked from commit feab35fe531843066db3418598874cf9f9419614)
-rw-r--r--lib/unicorn/util.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/unicorn/util.rb b/lib/unicorn/util.rb
index a735c68..e9dd57f 100644
--- a/lib/unicorn/util.rb
+++ b/lib/unicorn/util.rb
@@ -62,18 +62,18 @@ module Unicorn
 
           begin
             File.open(fp.path, 'a') { |tmpfp| fp.reopen(tmpfp) }
-          rescue IOError, Errno::EBADF
-            next
-          end
-          fp.sync = true
-          new_st = fp.stat
+            fp.sync = true
+            new_st = fp.stat
 
-          # this should only happen in the master:
-          if orig_st.uid != new_st.uid || orig_st.gid != new_st.gid
-            fp.chown(orig_st.uid, orig_st.gid)
-          end
+            # this should only happen in the master:
+            if orig_st.uid != new_st.uid || orig_st.gid != new_st.gid
+              fp.chown(orig_st.uid, orig_st.gid)
+            end
 
-          nr += 1
+            nr += 1
+          rescue IOError, Errno::EBADF
+            # not much we can do...
+          end
         end
 
         nr