cmd/root: Limit the scope of the error

https://github.com/containers/toolbox/pull/542
This commit is contained in:
Debarshi Ray 2020-08-26 22:26:49 +02:00
parent 354a69bede
commit 10b7de5e6c
1 changed files with 1 additions and 3 deletions

View File

@ -243,9 +243,7 @@ func migrate() error {
migrateLockFD := migrateLockFile.Fd()
migrateLockFDInt := int(migrateLockFD)
err = syscall.Flock(migrateLockFDInt, syscall.LOCK_EX)
if err != nil {
if err := syscall.Flock(migrateLockFDInt, syscall.LOCK_EX); err != nil {
return fmt.Errorf("failed to acquire migration lock")
}