MCPcopy Create free account
hub / github.com/an0nfunc/ALHP / stateFileMeta

Function stateFileMeta

utils.go:158–173  ·  view source on GitHub ↗
(stateFile string)

Source from the content-addressed store, hash-verified

156 if err != nil {
157 log.Warningf("unable to open repo lock %s: %v", path, err)
158 return nil
159 }
160 if err := syscall.Flock(int(f.Fd()), syscall.LOCK_SH); err != nil {
161 log.Warningf("unable to lock repo lock %s: %v", path, err)
162 _ = f.Close()
163 return nil
164 }
165 return f
166}
167
168// unlockRepo releases a lock taken by lockRepoShared. Closing the descriptor drops
169// the flock, so a nil file (lock never acquired) is a no-op.
170func unlockRepo(f *os.File) {
171 if f == nil {
172 return
173 }
174 _ = f.Close()
175}
176

Callers 2

GitVersionMethod · 0.85
genQueueMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected