Skip to content

Commit

Permalink
Use more appropriate func name for unrestricted mode changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnStarich committed Jul 12, 2020
1 parent 7b70cb1 commit 57ab25a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions memmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (m *MemMapFs) Mkdir(name string, perm os.FileMode) error {
m.registerWithParent(item)
m.mu.Unlock()

return m.unrestrictedChmod(name, perm|os.ModeDir)
return m.setFileMode(name, perm|os.ModeDir)
}

func (m *MemMapFs) MkdirAll(path string, perm os.FileMode) error {
Expand Down Expand Up @@ -238,7 +238,7 @@ func (m *MemMapFs) OpenFile(name string, flag int, perm os.FileMode) (File, erro
}
}
if chmod {
return file, m.unrestrictedChmod(name, perm)
return file, m.setFileMode(name, perm)
}
return file, nil
}
Expand Down Expand Up @@ -331,10 +331,10 @@ func (m *MemMapFs) Chmod(name string, mode os.FileMode) error {
prevOtherBits := mem.GetFileInfo(f).Mode() & ^chmodBits

mode = prevOtherBits | mode
return m.unrestrictedChmod(name, mode)
return m.setFileMode(name, mode)
}

func (m *MemMapFs) unrestrictedChmod(name string, mode os.FileMode) error {
func (m *MemMapFs) setFileMode(name string, mode os.FileMode) error {
name = normalizePath(name)

m.mu.RLock()
Expand Down

0 comments on commit 57ab25a

Please sign in to comment.