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.
master
Anis Elleuch 8 years ago committed by Harshavardhana
parent 393c01d078
commit f205689ff5
  1. 7
      pkg/sys/stats_linux.go

@ -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
}

Loading…
Cancel
Save