about 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 18:58:04 +0000
commitfeab35fe531843066db3418598874cf9f9419614 (patch)
tree776845cb687e969cd4f9ccf91445994c92d075af
parent18968f6aff2fa5ba5a7e3e3d47c9cc05cd6c260d (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.
-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