File: remove_try_close_file_decriptors.patch

package info (click to toggle)
ruby-daemons 1.1.9-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 316 kB
  • sloc: ruby: 2,349; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 663 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Author: Jonas Genannt <jonas.genannt@capi2name.de>
Description: this code was added in 1.1.9 but is not compatible with MRI > 1.8.
             MRI > 1.8 uses an separate thread to handle signals, which starts
             on VM initialization

--- a/lib/daemons/daemonize.rb
+++ b/lib/daemons/daemonize.rb
@@ -132,13 +132,6 @@
       end
     end
     
-    # Make sure all input/output streams are closed
-    # Part II: close all file decriptors (except for STDIN/STDOUT/STDERR)
-    ios = Array.new(8192) {|i| IO.for_fd(i) rescue nil}.compact
-    ios.each do |io|
-      next if io.fileno < 3
-      io.close
-    end
   end
   module_function :close_io