cli: syscall return value check is wrong

ret is uintptr and always >= 0. errno is enough for error checking.
This is causing lint error:
/home/vagrant/workplace/golang/src/github.com/kata-containers/runtime/virtcontainers/utils
cli/kata-check.go:446:20: SA4003: no value of type uintptr is less than 0 (staticcheck)
                if errno != 0 || ret <= 0 {
                                 ^

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao 2019-12-24 23:25:19 -08:00
parent a8717286ca
commit 652bb76dde

View File

@ -443,7 +443,7 @@ func genericCheckKVMExtensions(extensions map[string]kvmExtension) (map[string]i
// Generally return value(ret) 0 means no and 1 means yes,
// but some extensions may report additional information in the integer return value.
if errno != 0 || ret <= 0 {
if errno != 0 {
kataLog.WithFields(fields).Error("is not supported")
return results, errno
}