build: introduction of archConvertStatFs function

Type of StatFs is not always declared as int64 for all the architecture(e.g s390x).
The function archConvertStatFs could be reimplemented for other architecture
to correctly convert the StatFs.Type.

Fixes: #908

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
This commit is contained in:
Alice Frosi 2018-11-15 12:09:28 +00:00
parent 0911331974
commit b185f31c9e
2 changed files with 11 additions and 1 deletions

View File

@ -123,7 +123,7 @@ func isCgroupMounted(cgroupPath string) bool {
return false
}
if statFs.Type != int64(cgroupFsType) {
if statFs.Type != archConvertStatFs(cgroupFsType) {
return false
}

10
cli/utils_arch_base.go Normal file
View File

@ -0,0 +1,10 @@
// +build !s390x
//
// SPDX-License-Identifier: Apache-2.0
//
package main
func archConvertStatFs(cgroupFsType int) int64 {
return int64(cgroupFsType)
}