From c3720007e46443fbc49152c8015bcd101da5627e Mon Sep 17 00:00:00 2001 From: Kris Watts Date: Fri, 26 Jul 2019 12:05:16 -0600 Subject: [PATCH] Fixes issue #730 --- internal/common/common_linux.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/common/common_linux.go b/internal/common/common_linux.go index ea2860e..f558b74 100644 --- a/internal/common/common_linux.go +++ b/internal/common/common_linux.go @@ -43,7 +43,15 @@ func NumProcs() (uint64, error) { if err != nil { return 0, err } - return uint64(len(list)), err + var cnt uint64 + + for _, v := range list { + if _, err = strconv.ParseUint(v, 10, 64); err == nil { + cnt++ + } + } + + return cnt, nil } // cachedBootTime must be accessed via atomic.Load/StoreUint64