Skip to content

Commit

Permalink
Merge pull request #547 from weaveworks/arm-build
Browse files Browse the repository at this point in the history
Make Scope build on arm
  • Loading branch information
paulbellamy committed Oct 19, 2015
2 parents 48f41ad + aab15cd commit 6c336bd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
12 changes: 0 additions & 12 deletions probe/host/system_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ import (
// Uname is swappable for mocking in tests.
var Uname = syscall.Uname

func charsToString(ca [65]int8) string {
s := make([]byte, len(ca))
var lens int
for ; lens < len(ca); lens++ {
if ca[lens] == 0 {
break
}
s[lens] = uint8(ca[lens])
}
return string(s[0:lens])
}

// GetKernelVersion returns the kernel version as reported by uname.
var GetKernelVersion = func() (string, error) {
var utsname syscall.Utsname
Expand Down
15 changes: 15 additions & 0 deletions probe/host/system_utils_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// +build !arm

package host

func charsToString(ca [65]int8) string {
s := make([]byte, len(ca))
var lens int
for ; lens < len(ca); lens++ {
if ca[lens] == 0 {
break
}
s[lens] = uint8(ca[lens])
}
return string(s[0:lens])
}
13 changes: 13 additions & 0 deletions probe/host/system_utils_linux_arm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package host

func charsToString(ca [65]uint8) string {
s := make([]byte, len(ca))
var lens int
for ; lens < len(ca); lens++ {
if ca[lens] == 0 {
break
}
s[lens] = uint8(ca[lens])
}
return string(s[0:lens])
}

0 comments on commit 6c336bd

Please sign in to comment.