Skip to content

Commit

Permalink
change to readers lock when stat'ing a file
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoandredinis committed Jul 25, 2022
1 parent 43315dc commit e938bab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/client/identityfile/inmemory_config_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func (m InMemoryConfigWriter) Remove(name string) error {
// Stat returns the FileInfo of the given file.
// Returns fs.ErrNotExists if the file is not present
func (m InMemoryConfigWriter) Stat(name string) (fs.FileInfo, error) {
m.mux.Lock()
defer m.mux.Unlock()
m.mux.RLock()
defer m.mux.RUnlock()

f, found := m.files[name]
if !found {
Expand Down

0 comments on commit e938bab

Please sign in to comment.