err = unix.Flock(int(dirLock.Fd()), unix.LOCK_EX|unix.LOCK_NB)
if err != nil {
ctx.LogE("lockdir", SDS{"path": lockPath}, err, "")
- dirLock.Close()
+ dirLock.Close() // #nosec G104
return nil, err
}
return dirLock, nil
func (ctx *Ctx) UnlockDir(fd *os.File) {
if fd != nil {
- unix.Flock(int(fd.Fd()), unix.LOCK_UN)
- fd.Close()
+ unix.Flock(int(fd.Fd()), unix.LOCK_UN) // #nosec G104
+ fd.Close() // #nosec G104
}
}