about summary refs log tree commit homepage
path: root/ext/sleepy_penguin/eventfd.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-03-10 02:12:46 +0000
committerEric Wong <normalperson@yhbt.net>2011-03-10 02:12:46 +0000
commitd5af4d2738bc47f9ecc30b0900400833077f022b (patch)
tree31c177cd0a556abef7e3b10b2498939f6c0e03f9 /ext/sleepy_penguin/eventfd.c
parent601e98fa2f89b99c7349b5c010850dd6f4efba0b (diff)
downloadsleepy_penguin-d5af4d2738bc47f9ecc30b0900400833077f022b.tar.gz
No need to repeat it and bloat ourselves.
Diffstat (limited to 'ext/sleepy_penguin/eventfd.c')
-rw-r--r--ext/sleepy_penguin/eventfd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/sleepy_penguin/eventfd.c b/ext/sleepy_penguin/eventfd.c
index e7d7daf..20f74aa 100644
--- a/ext/sleepy_penguin/eventfd.c
+++ b/ext/sleepy_penguin/eventfd.c
@@ -1,7 +1,6 @@
 #ifdef HAVE_SYS_EVENTFD_H
 #include "sleepy_penguin.h"
 #include <sys/eventfd.h>
-#include "nonblock.h"
 static ID id_for_fd;
 
 /*
@@ -131,7 +130,7 @@ static VALUE incr(VALUE self, VALUE value)
         uint64_t val = (uint64_t)NUM2ULL(value);
         ssize_t w;
 
-        set_nonblock(fd);
+        rb_sp_set_nonblock(fd);
 retry:
         w = write(fd, &val, sizeof(uint64_t));
         if (w == -1) {
@@ -149,7 +148,7 @@ static VALUE getvalue(VALUE self)
         uint64_t val;
         ssize_t r;
 
-        set_nonblock(fd);
+        rb_sp_set_nonblock(fd);
 retry:
         r = read(fd, &val, sizeof(uint64_t));
         if (r == -1) {
@@ -176,7 +175,7 @@ static VALUE value_nonblock(VALUE self)
         uint64_t val;
         ssize_t r;
 
-        set_nonblock(fd);
+        rb_sp_set_nonblock(fd);
         r = read(fd, &val, sizeof(uint64_t));
         if (r == -1)
                 rb_sys_fail("read(eventfd)");
@@ -198,7 +197,7 @@ static VALUE incr_nonblock(VALUE self, VALUE value)
         uint64_t val = (uint64_t)NUM2ULL(value);
         ssize_t w;
 
-        set_nonblock(fd);
+        rb_sp_set_nonblock(fd);
         w = write(fd, &val, sizeof(uint64_t));
         if (w == -1)
                 rb_sys_fail("write(eventfd)");