kqueue: ensure close-on-exec flag is set
commitfc95889d3f9bb9129d8c46025bd3ca2847c0b557
authorEric Wong <e@80x24.org>
Fri, 14 Apr 2017 01:54:36 +0000 (14 01:54 +0000)
committerEric Wong <e@80x24.org>
Fri, 14 Apr 2017 23:27:37 +0000 (14 23:27 +0000)
tree7efb7ebdb0b36d8128d26cecfbd4b774a3ed7715
parent00492c434ea26696ab3c9be5a2b5020fb02f7d32
kqueue: ensure close-on-exec flag is set

Calling IO::new apparently does not set the close-on-exec flag
in Ruby 2.x (tested with 2.2.6 on FreeBSD), so we must set it
ourselves.

It's not a huge deal to be missing close-on-exec for kqueue,
since kqueue already has close-on-fork behavior(!) and it's rare
for a process using kqueue to exec without forking, first.
ext/sleepy_penguin/kqueue.c
test/test_kqueue.rb