From b185f31c9e5fab5878aa7da86605b9d1a91e056c Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Thu, 15 Nov 2018 12:09:28 +0000 Subject: [PATCH] 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 --- cli/oci.go | 2 +- cli/utils_arch_base.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 cli/utils_arch_base.go diff --git a/cli/oci.go b/cli/oci.go index 67077843e5..9f19a0440b 100644 --- a/cli/oci.go +++ b/cli/oci.go @@ -123,7 +123,7 @@ func isCgroupMounted(cgroupPath string) bool { return false } - if statFs.Type != int64(cgroupFsType) { + if statFs.Type != archConvertStatFs(cgroupFsType) { return false } diff --git a/cli/utils_arch_base.go b/cli/utils_arch_base.go new file mode 100644 index 0000000000..a0c6a5e71f --- /dev/null +++ b/cli/utils_arch_base.go @@ -0,0 +1,10 @@ +// +build !s390x +// +// SPDX-License-Identifier: Apache-2.0 +// + +package main + +func archConvertStatFs(cgroupFsType int) int64 { + return int64(cgroupFsType) +}