diff options
Diffstat (limited to 'libpod/lock/shm_lock.go')
-rw-r--r-- | libpod/lock/shm_lock.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libpod/lock/shm_lock.go b/libpod/lock/shm_lock.go index 4d7c26aa2..a8a969479 100644 --- a/libpod/lock/shm_lock.go +++ b/libpod/lock/shm_lock.go @@ -27,13 +27,13 @@ type SHMLocks struct { // semaphores, and returns a struct that can be used to operate on those locks. // numLocks must be a multiple of the lock bitmap size (by default, 32). func CreateSHMLock(numLocks uint32) (*SHMLocks, error) { - if numLocks % bitmapSize != 0 || numLocks == 0 { + if numLocks%bitmapSize != 0 || numLocks == 0 { return nil, errors.Wrapf(syscall.EINVAL, "number of locks must be a multiple of %d", C.bitmap_size_c) } locks := new(SHMLocks) - var errCode C.int = 0 + var errCode C.int lockStruct := C.setup_lock_shm(C.uint32_t(numLocks), &errCode) if lockStruct == nil { // We got a null pointer, so something errored @@ -52,13 +52,13 @@ func CreateSHMLock(numLocks uint32) (*SHMLocks, error) { // segment was created with and be a multiple of the lock bitmap size (default // 32). func OpenSHMLock(numLocks uint32) (*SHMLocks, error) { - if numLocks % bitmapSize != 0 || numLocks == 0 { + if numLocks%bitmapSize != 0 || numLocks == 0 { return nil, errors.Wrapf(syscall.EINVAL, "number of locks must be a multiple of %d", C.bitmap_size_c) } locks := new(SHMLocks) - var errCode C.int = 0 + var errCode C.int lockStruct := C.open_lock_shm(C.uint32_t(numLocks), &errCode) if lockStruct == nil { // We got a null pointer, so something errored |