Merge pull request #2525 from kluppy/master

Don't chmod in Atomic on android (fixes  #2472)
This commit is contained in:
Jakob Borg 2015-11-28 22:57:00 +01:00
commit 1ebc9a9a88

View File

@ -37,10 +37,13 @@ func CreateAtomic(path string, mode os.FileMode) (*AtomicWriter, error) {
return nil, err
}
if err := os.Chmod(fd.Name(), mode); err != nil {
fd.Close()
os.Remove(fd.Name())
return nil, err
// chmod fails on Android so don't even try
if runtime.GOOS != "android" {
if err := os.Chmod(fd.Name(), mode); err != nil {
fd.Close()
os.Remove(fd.Name())
return nil, err
}
}
w := &AtomicWriter{