mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
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:
parent
393c01d078
commit
f205689ff5
@ -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…
Reference in New Issue
Block a user