about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-06-18 20:32:39 +0000
committerEric Wong <normalperson@yhbt.net>2012-06-18 20:32:39 +0000
commita5b987619f4b793203f6a50e424fe98c5b0794ba (patch)
tree1da94546c405e354851f18d2d21a854350ca4e8c
parent604f64f624d562f480dc8424a6597ec5b32947df (diff)
downloadrainbows-a5b987619f4b793203f6a50e424fe98c5b0794ba.tar.gz
Triggering Errno::EBADF is tricky in multithreaded situations
due to possible race conditions and yet-to-be discovered bugs.
shutdown(2) is also safe against apps the fork() internally but
do not execve(2) nor set FD_CLOEXEC.

n.b. calling fork() after pthreads are spawned may not be safe
on all platforms w.r.t. malloc, but /is/ the case for glibc on
GNU/Linux.
-rw-r--r--lib/rainbows/epoll/client.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rainbows/epoll/client.rb b/lib/rainbows/epoll/client.rb
index 891e959..f690d85 100644
--- a/lib/rainbows/epoll/client.rb
+++ b/lib/rainbows/epoll/client.rb
@@ -181,7 +181,7 @@ module Rainbows::Epoll::Client
   end
 
   def timeout!
-    close
+    shutdown
     true
   end