Merge pull request #979 from jimmidyson/readint64
Rename readInt64 -> readUInt64 for clarity
This commit is contained in:
commit
34036be6e0
@ -138,7 +138,7 @@ func readString(dirpath string, file string) string {
|
|||||||
return strings.TrimSpace(string(out))
|
return strings.TrimSpace(string(out))
|
||||||
}
|
}
|
||||||
|
|
||||||
func readInt64(dirpath string, file string) uint64 {
|
func readUInt64(dirpath string, file string) uint64 {
|
||||||
out := readString(dirpath, file)
|
out := readString(dirpath, file)
|
||||||
if out == "" {
|
if out == "" {
|
||||||
return 0
|
return 0
|
||||||
@ -199,7 +199,7 @@ func (self *rawContainerHandler) GetSpec() (info.ContainerSpec, error) {
|
|||||||
if ok {
|
if ok {
|
||||||
if utils.FileExists(cpuRoot) {
|
if utils.FileExists(cpuRoot) {
|
||||||
spec.HasCpu = true
|
spec.HasCpu = true
|
||||||
spec.Cpu.Limit = readInt64(cpuRoot, "cpu.shares")
|
spec.Cpu.Limit = readUInt64(cpuRoot, "cpu.shares")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,8 +238,8 @@ func (self *rawContainerHandler) GetSpec() (info.ContainerSpec, error) {
|
|||||||
if ok {
|
if ok {
|
||||||
if utils.FileExists(memoryRoot) {
|
if utils.FileExists(memoryRoot) {
|
||||||
spec.HasMemory = true
|
spec.HasMemory = true
|
||||||
spec.Memory.Limit = readInt64(memoryRoot, "memory.limit_in_bytes")
|
spec.Memory.Limit = readUInt64(memoryRoot, "memory.limit_in_bytes")
|
||||||
spec.Memory.SwapLimit = readInt64(memoryRoot, "memory.memsw.limit_in_bytes")
|
spec.Memory.SwapLimit = readUInt64(memoryRoot, "memory.memsw.limit_in_bytes")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user