summaryrefslogtreecommitdiff
path: root/net/ocsinventory-agent/patches/patch-ah
blob: 8c55397ffd6c72e8cae1aed584efbf1a1ec632c8 (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
$NetBSD: patch-ah,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $

--- /dev/null	2009-06-25 18:52:46.000000000 +0200
+++ ./lib/Ocsinventory/Agent/Backend/OS/BSD/Pcictl.pm	2009-06-25 18:43:12.000000000 +0200
@@ -0,0 +1,22 @@
+package Ocsinventory::Agent::Backend::OS::BSD::Pcictl;
+use strict;
+
+sub check {can_run("pcictl")}
+
+sub run {}
+
+sub runpcictl {
+	my @devices;
+	opendir DEV, "/dev" or die "can't open /dev";
+	while (my $file = readdir DEV) {
+		if ($file =~ m/^pci[0-9]+$/) {
+			foreach (`pcictl $file list`) {
+				chop $_;
+				push @devices, $_;
+			}
+		}
+	}
+	return @devices;
+}
+
+1;