about summary refs log tree commit homepage
path: root/test/test_inet_diag_socket.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_inet_diag_socket.rb')
-rw-r--r--test/test_inet_diag_socket.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test_inet_diag_socket.rb b/test/test_inet_diag_socket.rb
index c40d50e..047dff3 100644
--- a/test/test_inet_diag_socket.rb
+++ b/test/test_inet_diag_socket.rb
@@ -1,6 +1,7 @@
 # -*- encoding: binary -*-
 require 'test/unit'
 require 'raindrops'
+require 'fcntl'
 $stderr.sync = $stdout.sync = true
 
 class TestInetDiagSocket < Test::Unit::TestCase
@@ -8,6 +9,8 @@ class TestInetDiagSocket < Test::Unit::TestCase
     sock = Raindrops::InetDiagSocket.new
     assert_kind_of Socket, sock
     assert_kind_of Fixnum, sock.fileno
+    flags = sock.fcntl(Fcntl::F_GETFD)
+    assert_equal Fcntl::FD_CLOEXEC, flags & Fcntl::FD_CLOEXEC
     assert_nil sock.close
   end
 end if RUBY_PLATFORM =~ /linux/