| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Mongrel
Revision: 1036
Author: normalperson
Date: 20 Aug 2008 04:20:53
Changes:set close-on-exec flag on listen socket
Original patch from Jos Backus, modified to work on weird platforms
where Fcntl::FD_CLOEXEC may not be defined.
Jos Backus wrote:
> Mongrel, at least in 1.1.4, doesn't set the close-on-exec flag
> on the listen socket. This leads to trouble in programs that
> use Mongrel and fork other programs (like puppetmasterd, part
> of Puppet). For an example, see
> http://groups.google.com/group/puppet-dev/browse_thread/thread/463f0f8cfc80cc43
| ... | ...@@ -91,6 +91,9 @@ | |
| 91 | 91 | |
| 92 | 92 | tries = 0 |
| 93 | 93 | @socket = TCPServer.new(host, port) |
| 94 | if defined?(Fcntl::FD_CLOEXEC) | |
| 95 | @socket.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) | |
| 96 | end | |
| 94 | 97 | |
| 95 | 98 | @classifier = URIClassifier.new |
| 96 | 99 | @host = host |