summaryrefslogtreecommitdiff
path: root/net/ocsinventory-agent/patches/patch-ak
blob: f0cb6f0fb330f57b70111e36cf1b95447c5e57f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$NetBSD: patch-ak,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $

--- lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/I386.pm.orig	2009-07-30 15:47:09.000000000 +0200
+++ lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/I386.pm	2009-07-30 15:52:59.000000000 +0200
@@ -29,14 +29,16 @@
   # proc type with sysctl (hw.model)
   chomp($processort=`sysctl -n hw.model`);
   # XXX quick and dirty _attempt_ to get proc speed through dmesg
-  for(`dmesg`){
-      my $tmp;
-      if (/^cpu\S*\s.*\D[\s|\(]([\d|\.]+)[\s|-]mhz/i) { # XXX unsure
-	  $tmp = $1;
-	  $tmp =~ s/\..*//;
-	  $processors=$tmp;
-	  last
-	  }
+  if ( -r "/var/run/dmesg.boot") {
+	for(`cat /var/run/dmesg.boot`){
+	    my $tmp;
+	    if (/^cpu\S*\s.*\D[\s|\(]([\d|\.]+)[\s|-]mhz/i) { # XXX unsure
+		  $tmp = $1;
+		  $tmp =~ s/\..*//;
+		  $processors=$tmp;
+		  last
+		  }
+	}
   }
 
 # Writing data