build: Fix compilation in 32 bits platforms (#4052)

go fails to build Minio under at least, armv6 and 386 due to some
inconsistencies in the type of one syscall variable in different
architectures. This PR casts that variable to uint64 to achieve
the desired consistency.
This commit is contained in:
Anis Elleuch 2017-04-05 19:17:59 +01:00 committed by Harshavardhana
parent 393c01d078
commit f205689ff5

View file

@ -62,9 +62,14 @@ func getSysinfoMemoryLimit() (limit uint64, err error) {
return 0, err
}
// Some fields in syscall.Sysinfo_t have different integer sizes
// in different platform architectures. Cast all fields to uint64.
totalRAM := uint64(si.Totalram)
unit := uint64(si.Unit)
// Total RAM is always the multiplicative value
// of unit size and total ram.
limit = uint64(si.Unit) * si.Totalram
limit = unit * totalRAM
return limit, nil
}