File: 0001-Invoke-unix_listener_stats-conditionally.patch

package info (click to toggle)
ruby-raindrops 0.20.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 500 kB
  • sloc: ruby: 3,537; ansic: 1,029; sh: 32; makefile: 9
file content (24 lines) | stat: -rw-r--r-- 953 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
22
23
24
From: Dmitry Borodaenko <angdraug@debian.org>
Date: Thu, 15 Mar 2012 21:40:35 +0300
Subject: Invoke unix_listener_stats conditionally

unix_listener_stats reads /proc/net/unix on every invokation, that is
not only expensive, but also breaks the test suite when build process
isn't allowed to access /proc.
---
 lib/raindrops/watcher.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/raindrops/watcher.rb b/lib/raindrops/watcher.rb
index ac5b895..a24ea69 100644
--- a/lib/raindrops/watcher.rb
+++ b/lib/raindrops/watcher.rb
@@ -171,7 +171,7 @@ def aggregator_thread(logger) # :nodoc:
     thr = Thread.new do
       begin
         combined = tcp_listener_stats(@tcp_listeners, sock)
-        combined.merge!(unix_listener_stats(@unix_listeners))
+        combined.merge!(unix_listener_stats(@unix_listeners)) if @unix_listeners
         @lock.synchronize do
           now = Time.now.utc
           combined.each do |addr,stats|