about summary refs log tree commit homepage
path: root/ext/sleepy_penguin/eventfd.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-04-13 11:29:33 +0000
committerEric Wong <normalperson@yhbt.net>2013-04-13 11:29:33 +0000
commit92b55d65af197218b7653018847b14141cd393de (patch)
tree1e91f6287bdd57c77f8e0bc7c4173c4034e5cb9c /ext/sleepy_penguin/eventfd.c
parent856e3e6706a9ab40047eff22f0ddc9dd40ecdde2 (diff)
downloadsleepy_penguin-92b55d65af197218b7653018847b14141cd393de.tar.gz
Ruby 2.0 creates file descriptors with the close-on-exec flag
specified by default.  Unless a user specifies flags explicitly,
assume the default is to set the close-on-exec.

This does not change behavior of Ruby 1.9 and earlier.
Diffstat (limited to 'ext/sleepy_penguin/eventfd.c')
-rw-r--r--ext/sleepy_penguin/eventfd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/sleepy_penguin/eventfd.c b/ext/sleepy_penguin/eventfd.c
index 3ba8397..1713fdd 100644
--- a/ext/sleepy_penguin/eventfd.c
+++ b/ext/sleepy_penguin/eventfd.c
@@ -27,7 +27,7 @@ static VALUE s_new(int argc, VALUE *argv, VALUE klass)
 
         rb_scan_args(argc, argv, "11", &_initval, &_flags);
         initval = NUM2UINT(_initval);
-        flags = rb_sp_get_flags(klass, _flags);
+        flags = rb_sp_get_flags(klass, _flags, RB_SP_CLOEXEC(EFD_CLOEXEC));
 
         fd = eventfd(initval, flags);
         if (fd == -1) {