summary refs log tree commit
diff options
context:
space:
mode:
authorSophie Deziel <courrier@sophiedeziel.com>2016-06-14 13:52:52 -0400
committerSophie Deziel <courrier@sophiedeziel.com>2016-06-14 13:52:52 -0400
commit5422359a36f2c9f06552340921d1a55656354fda (patch)
treef680983bd6674e02f7b57a3791cee8a210f7006c
parent2f8b7107c698e8def48a389cacd8882ba517105c (diff)
downloadrack-5422359a36f2c9f06552340921d1a55656354fda.tar.gz
use FileUtils.rm_f instead of File.delete to prevent exceptions
-rw-r--r--lib/rack/server.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rack/server.rb b/lib/rack/server.rb
index f8ac3ac2..b4d10bd3 100644
--- a/lib/rack/server.rb
+++ b/lib/rack/server.rb
@@ -359,7 +359,7 @@ module Rack
 
       def write_pid
         ::File.open(options[:pid], ::File::CREAT | ::File::EXCL | ::File::WRONLY ){ |f| f.write("#{Process.pid}") }
-        at_exit { ::File.delete(options[:pid]) rescue Errno::ENOENT }
+        at_exit { ::FileUtils.rm_f(options[:pid]) }
       rescue Errno::EEXIST
         check_pid!
         retry