Upstream spf13/afero state of the touched files before ac8fa0258e
This commit is contained in:
1 parent
b778e8e78b
commit
d43dc733dc
2 files changed
+1
-32
No files matched your search
@@ -263,9 +263,7 @@ func (m *MemMapFs) OpenFile(name string, flag int, perm os.FileMode) (File, erro
|
||||
perm &= chmodBits
|
||||
chmod := false
|
||||
file, err := m.openWrite(name)
|
||||
// O_EXCL is only meaningful together with O_CREATE (POSIX); without
|
||||
// O_CREATE it must not prevent opening an existing file.
|
||||
if err == nil && flag&os.O_EXCL > 0 && flag&os.O_CREATE > 0 {
|
||||
if err == nil && (flag&os.O_EXCL > 0) {
|
||||
return nil, &os.PathError{Op: "open", Path: name, Err: ErrFileExists}
|
||||
}
|
||||
if os.IsNotExist(err) && (flag&os.O_CREATE > 0) {
|
||||
|
||||
Reference in new issue
Block a user