You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1016 B
33 lines
1016 B
From 43da65cd2af00d8e7162461835b039bc5ee7d5c8 Mon Sep 17 00:00:00 2001
|
|
From: Bernhard Furtmueller <furti@1012surf.net>
|
|
Date: Tue, 23 Jun 2009 23:18:01 +0200
|
|
Subject: [PATCH] Fixed #2355 read hang on /proc/xen/capabilties on RHEL 4.7
|
|
Signed-off-by: Bernhard Furtmueller <furti@1012surf.net>
|
|
|
|
---
|
|
lib/facter/virtual.rb | 8 +++++---
|
|
1 files changed, 5 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
|
|
index 72bfe51..8c11b40 100644
|
|
--- a/lib/facter/virtual.rb
|
|
+++ b/lib/facter/virtual.rb
|
|
@@ -41,9 +41,11 @@ Facter.add("virtual") do
|
|
end
|
|
|
|
if FileTest.exists?("/proc/xen/capabilities")
|
|
- txt = File.read("/proc/xen/capabilities")
|
|
- if txt =~ /control_d/i
|
|
- result = "xen0"
|
|
+ Thread::exclusive do
|
|
+ txt = File.read("/proc/xen/capabilities")
|
|
+ if txt =~ /control_d/i
|
|
+ result = "xen0"
|
|
+ end
|
|
end
|
|
end
|
|
|
|
--
|
|
1.6.0.4
|
|
|