about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-02-07 16:09:53 -0800
committerEric Wong <normalperson@yhbt.net>2011-02-07 16:09:53 -0800
commit1fd1234ca5ba3d84d2182c38b37322bd55f08882 (patch)
treef3846aca3aa7677c6781e2e963e924442b03f8e6 /test
parent6ffc294aac4735127ac9455266623aaa3603e9c1 (diff)
downloadunicorn-1fd1234ca5ba3d84d2182c38b37322bd55f08882.tar.gz
No need to unnecessarily leave file descriptor open.
Diffstat (limited to 'test')
-rw-r--r--test/test_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index c87cc1a..d9ff90c 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -110,7 +110,7 @@ def unused_port(addr = '127.0.0.1')
     # when running tests in parallel with gmake.  Create a lock file while
     # we have the port here to ensure that does not happen .
     lock_path = "#{Dir::tmpdir}/unicorn_test.#{addr}:#{port}.lock"
-    File.open(lock_path, File::WRONLY|File::CREAT|File::EXCL, 0600)
+    File.open(lock_path, File::WRONLY|File::CREAT|File::EXCL, 0600).close
     at_exit { File.unlink(lock_path) rescue nil }
   rescue Errno::EEXIST
     sock.close rescue nil