X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Flockdir.go;h=a756381bee0f5d353d602112c75080cef0704694;hb=HEAD;hp=902ec22124b624c73c145b20463f0616cf3d1595;hpb=f74ee2d73c6f1c1dd8e5c7caf8a8118d80a2be89;p=nncp.git diff --git a/src/lockdir.go b/src/lockdir.go index 902ec22..1e4e394 100644 --- a/src/lockdir.go +++ b/src/lockdir.go @@ -1,6 +1,6 @@ /* NNCP -- Node to Node copy, utilities for store-and-forward data exchange -Copyright (C) 2016-2021 Sergey Matveev +Copyright (C) 2016-2023 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +45,7 @@ func (ctx *Ctx) LockDir(nodeId *NodeId, lockCtx string) (*os.File, error) { ctx.LogE("lockdir-flock", LEs{{"Path", lockPath}}, err, func(les LEs) string { 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() } }