diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-02-07 16:09:53 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-02-07 16:09:53 -0800 |
commit | 1fd1234ca5ba3d84d2182c38b37322bd55f08882 (patch) | |
tree | f3846aca3aa7677c6781e2e963e924442b03f8e6 /test/test_helper.rb | |
parent | 6ffc294aac4735127ac9455266623aaa3603e9c1 (diff) | |
download | unicorn-1fd1234ca5ba3d84d2182c38b37322bd55f08882.tar.gz |
No need to unnecessarily leave file descriptor open.
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 2 |
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 |