]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/lockdir.go
Updated github.com/klauspost/compress without snappy dependency
[nncp.git] / src / lockdir.go
index 2219d1bcfcd61643ada18a0df56557690d446990..e94117b191395af94dc97ee9b0a5ed2de63b677a 100644 (file)
@@ -36,16 +36,16 @@ func (ctx *Ctx) LockDir(nodeId *NodeId, lockCtx string) (*os.File, error) {
        )
        if err != nil {
                ctx.LogE("lockdir-open", LEs{{"Path", lockPath}}, err, func(les LEs) string {
-                       return "Locking directory: opening %s" + lockPath
+                       return "Locking directory: opening " + lockPath
                })
                return nil, err
        }
        err = unix.Flock(int(dirLock.Fd()), unix.LOCK_EX|unix.LOCK_NB)
        if err != nil {
                ctx.LogE("lockdir-flock", LEs{{"Path", lockPath}}, err, func(les LEs) string {
-                       return "Locking directory: locking %s" + lockPath
+                       return "Locking directory: locking " + lockPath
                })
-               dirLock.Close() // #nosec G104
+               dirLock.Close()
                return nil, err
        }
        return dirLock, nil
@@ -53,7 +53,7 @@ func (ctx *Ctx) LockDir(nodeId *NodeId, lockCtx string) (*os.File, error) {
 
 func (ctx *Ctx) UnlockDir(fd *os.File) {
        if fd != nil {
-               unix.Flock(int(fd.Fd()), unix.LOCK_UN) // #nosec G104
-               fd.Close()                             // #nosec G104
+               unix.Flock(int(fd.Fd()), unix.LOCK_UN)
+               fd.Close()
        }
 }