FD_CLOEXEC all non-listen descriptors before exec
commitac01d8c83b6a3e0d9d0883d9df17f45e208ac101
authorEric Wong <normalperson@yhbt.net>
Thu, 2 Apr 2009 03:13:21 +0000 (1 20:13 -0700)
committerEric Wong <normalperson@yhbt.net>
Thu, 2 Apr 2009 04:34:21 +0000 (1 21:34 -0700)
tree54d1cef97e423fdf7fb169f52fcb7415cd125c82
parente3a6639e270157c4fdc4112a6996c9e7d74acedd
FD_CLOEXEC all non-listen descriptors before exec

We'll allow before_exec to override that setting, however.

There are cases where someone setting
Logger.new("/path/to/file") will create new file descriptors in
the master process.  This will prevent FD leakage
and a test case (for Linux only) proves it.
lib/unicorn.rb
test/exec/test_exec.rb