aboutsummaryrefslogtreecommitdiffstats
path: root/community/zabbix/zabbix_agent2-uname-linux.patch
blob: 08ca12ea2f7fd30b3ed5080b0f0a372c3b750e9a (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff --git a/go/src/zabbix/plugins/system/uname/uname_int8.go b/go/src/zabbix/plugins/system/uname/uname_int8.go
new file mode 100644
index 0000000..5bad4ca
--- /dev/null
+++ b/go/src/zabbix/plugins/system/uname/uname_int8.go
@@ -0,0 +1,15 @@
+// +build linux,386 linux,amd64 linux,arm64
+
+package uname
+
+func arrayToString(unameArray *[65]int8) string {
+	var byteString [65]byte
+	var indexLength int
+	for ; indexLength < len(unameArray); indexLength++ {
+		if 0 == unameArray[indexLength] {
+			break
+		}
+		byteString[indexLength] = uint8(unameArray[indexLength])
+	}
+	return string(byteString[:indexLength])
+}
diff --git a/go/src/zabbix/plugins/system/uname/uname_linux.go b/go/src/zabbix/plugins/system/uname/uname_linux.go
index 874569f..6dac18b 100644
--- a/go/src/zabbix/plugins/system/uname/uname_linux.go
+++ b/go/src/zabbix/plugins/system/uname/uname_linux.go
@@ -24,18 +24,6 @@ import (
 	"syscall"
 )
 
-func arrayToString(unameArray *[65]int8) string {
-	var byteString [65]byte
-	var indexLength int
-	for ; indexLength < len(unameArray); indexLength++ {
-		if 0 == unameArray[indexLength] {
-			break
-		}
-		byteString[indexLength] = uint8(unameArray[indexLength])
-	}
-	return string(byteString[:indexLength])
-}
-
 func getUname() (uname string, err error) {
 	var utsname syscall.Utsname
 	if err = syscall.Uname(&utsname); err != nil {
diff --git a/go/src/zabbix/plugins/system/uname/uname_uint8.go b/go/src/zabbix/plugins/system/uname/uname_uint8.go
new file mode 100644
index 0000000..893d6c5
--- /dev/null
+++ b/go/src/zabbix/plugins/system/uname/uname_uint8.go
@@ -0,0 +1,15 @@
+// +build linux,arm linux,ppc64le linux,s390x
+
+package uname
+
+func arrayToString(unameArray *[65]uint8) string {
+	var byteString [65]byte
+	var indexLength int
+	for ; indexLength < len(unameArray); indexLength++ {
+		if 0 == unameArray[indexLength] {
+			break
+		}
+		byteString[indexLength] = uint8(unameArray[indexLength])
+	}
+	return string(byteString[:indexLength])
+}