connect,tryopen: set close-on-exec flag for new fds on Ruby 2.0+
commitbe3672501ecde716dae723e887d4a9e4d731240c
authorEric Wong <normalperson@yhbt.net>
Thu, 17 Nov 2011 02:37:37 +0000 (16 18:37 -0800)
committerEric Wong <normalperson@yhbt.net>
Fri, 18 Nov 2011 01:58:06 +0000 (17 17:58 -0800)
tree07c6fc18258a4adecf51deb7e2136d81892cac08
parent48dc3c5a1943801311567e72a8e69fcb0cd8cf8d
connect,tryopen: set close-on-exec flag for new fds on Ruby 2.0+

All IO objects created by Kgio will have FD_CLOEXEC descriptor
flag set on it when run under Ruby 2.0.0dev.  This matches the
upcoming behavior of Ruby 2.0.0dev for IO objects in the core
and standard library.  This change does not affect users on Ruby
1.9.3 and earlier.

accept()-ed sockets in kgio have _always_ had FD_CLOEXEC
set by default.
ext/kgio/connect.c
ext/kgio/extconf.rb
ext/kgio/tryopen.c
test/test_tcp_connect.rb
test/test_tryopen.rb
test/test_unix_connect.rb