From 4dec50ba51808ca6efa215e7104799d5f29a580e Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 16 Aug 2016 14:40:16 -0700 Subject: [PATCH] build: Add platform specific fixes. --- pkg/sys/stats_linux.go | 2 +- server-rlimit-nix.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/sys/stats_linux.go b/pkg/sys/stats_linux.go index dcf5a9fa7..090235bc4 100644 --- a/pkg/sys/stats_linux.go +++ b/pkg/sys/stats_linux.go @@ -28,7 +28,7 @@ func GetStats() (stats Stats, err error) { return } stats = Stats{ - TotalRAM: si.Totalram, + TotalRAM: uint64(si.Totalram), } return stats, nil } diff --git a/server-rlimit-nix.go b/server-rlimit-nix.go index 13a233b52..c69500a7c 100644 --- a/server-rlimit-nix.go +++ b/server-rlimit-nix.go @@ -73,8 +73,8 @@ func setMaxMemory() error { } // Validate if rlimit memory is set to lower // than max cache size. Then we should use such value. - if rLimit.Cur < globalMaxCacheSize { - globalMaxCacheSize = (80 / 100) * rLimit.Cur + if uint64(rLimit.Cur) < globalMaxCacheSize { + globalMaxCacheSize = (80 / 100) * uint64(rLimit.Cur) } // Make sure globalMaxCacheSize is less than RAM size.