From 11287600ce1a69eb114fcb0d6908132913be203b Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Tue, 7 Jul 2009 02:43:26 -0300 Subject: [PATCH] Consider MinGW as valid Windows platform. --- History.txt | 1 + lib/mongrel/configurator.rb | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/History.txt b/History.txt index 8c9e425b..75520c21 100644 --- a/History.txt +++ b/History.txt @@ -6,6 +6,7 @@ * Ruby 1.9 early compatbility: Merged commits form Eric Wong. * Better RubyGems support thanks to added env she-bang to mongrel_rails executable. * Fixed proper version reporting under 1.9 +* Consider MinGW as valid Windows platform. === 1.1.5 / 2008-05-22 diff --git a/lib/mongrel/configurator.rb b/lib/mongrel/configurator.rb index e4ec31b3..b251c7f9 100644 --- a/lib/mongrel/configurator.rb +++ b/lib/mongrel/configurator.rb @@ -81,13 +81,13 @@ module Mongrel # Writes the PID file if we're not on Windows. def write_pid_file - if RUBY_PLATFORM !~ /mswin/ + if RUBY_PLATFORM !~ /mingw|mswin/ log "Writing PID file to #{@pid_file}" open(@pid_file,"w") {|f| f.write(Process.pid) } open(@pid_file,"w") do |f| f.write(Process.pid) File.chmod(0644, @pid_file) - end + end end end @@ -185,7 +185,7 @@ module Mongrel def daemonize(options={}) ops = resolve_defaults(options) # save this for later since daemonize will hose it - if RUBY_PLATFORM !~ /mswin/ + if RUBY_PLATFORM !~ /mingw|mswin/ require 'daemons/daemonize' logfile = ops[:log_file] @@ -366,7 +366,7 @@ module Mongrel # clean up the pid file always at_exit { remove_pid_file } - if RUBY_PLATFORM !~ /mswin/ + if RUBY_PLATFORM !~ /mingw|mswin/ # graceful shutdown trap("TERM") { log "TERM signal received."; stop } trap("USR1") { log "USR1 received, toggling $mongrel_debug_client to #{!$mongrel_debug_client}"; $mongrel_debug_client = !$mongrel_debug_client }