about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-02-04 22:02:25 +0000
committerEric Wong <normalperson@yhbt.net>2011-02-04 22:02:25 +0000
commit92a666f3ff27539655e9130db16bd1587db061de (patch)
treeb47c84d612312559d723fa5188f9887378d24d46
parent6540be80d8dca8cf93e74273d04211c1a73a674e (diff)
downloadsleepy_penguin-92a666f3ff27539655e9130db16bd1587db061de.tar.gz
No need to differ from other file descriptors, even though
it would be better if *all* file descriptors would default to
O_CLOEXEC.
-rw-r--r--ext/sleepy_penguin/epoll.c4
-rw-r--r--test/test_epoll.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/ext/sleepy_penguin/epoll.c b/ext/sleepy_penguin/epoll.c
index c94fd3f..38f9113 100644
--- a/ext/sleepy_penguin/epoll.c
+++ b/ext/sleepy_penguin/epoll.c
@@ -115,7 +115,7 @@ static VALUE alloc(VALUE klass)
         ep->marks = Qnil;
         ep->flag_cache = Qnil;
         ep->capa = step;
-        ep->flags = EPOLL_CLOEXEC;
+        ep->flags = 0;
         ep->events = xmalloc(sizeof(struct epoll_event) * ep->capa);
 
         return self;
@@ -162,7 +162,7 @@ static VALUE init(int argc, VALUE *argv, VALUE self)
 
         rb_scan_args(argc, argv, "01", &fl);
         if (NIL_P(fl)) {
-                flags = EPOLL_CLOEXEC;
+                flags = 0;
         } else {
                 switch (TYPE(fl)) {
                 case T_FIXNUM:
diff --git a/test/test_epoll.rb b/test/test_epoll.rb
index b75c2b7..4c8dfa6 100644
--- a/test/test_epoll.rb
+++ b/test/test_epoll.rb
@@ -317,7 +317,7 @@ class TestEpoll < Test::Unit::TestCase
   def test_new
     @ep.close
     io = Epoll.new.to_io
-    assert((io.fcntl(Fcntl::F_GETFD) & Fcntl::FD_CLOEXEC) == Fcntl::FD_CLOEXEC)
+    assert_equal 0, io.fcntl(Fcntl::F_GETFD)
   end
 
   def test_delete