mirror of https://github.com/golang/go.git
syscall: accept pre-existing directories in nacl zip file
NaCl creates /tmp. This lets the zip file populate it. LGTM=adg R=adg CC=golang-codereviews https://golang.org/cl/159600043
This commit is contained in:
parent
2fe9482343
commit
1c534714e1
|
|
@ -818,6 +818,12 @@ func create(name string, mode uint32, sec int64, data []byte) error {
|
|||
fs.mu.Unlock()
|
||||
f, err := fs.open(name, O_CREATE|O_EXCL, mode)
|
||||
if err != nil {
|
||||
if mode&S_IFMT == S_IFDIR {
|
||||
ip, _, err := fs.namei(name, false)
|
||||
if err == nil && (ip.Mode&S_IFMT) == S_IFDIR {
|
||||
return nil // directory already exists
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
ip := f.(*fsysFile).inode
|
||||
|
|
|
|||
Loading…
Reference in New Issue