mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 19:08:58 +00:00
Merge pull request #2525 from kluppy/master
Don't chmod in Atomic on android (fixes #2472)
This commit is contained in:
commit
1ebc9a9a88
@ -37,10 +37,13 @@ func CreateAtomic(path string, mode os.FileMode) (*AtomicWriter, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := os.Chmod(fd.Name(), mode); err != nil {
|
// chmod fails on Android so don't even try
|
||||||
fd.Close()
|
if runtime.GOOS != "android" {
|
||||||
os.Remove(fd.Name())
|
if err := os.Chmod(fd.Name(), mode); err != nil {
|
||||||
return nil, err
|
fd.Close()
|
||||||
|
os.Remove(fd.Name())
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
w := &AtomicWriter{
|
w := &AtomicWriter{
|
||||||
|
Loading…
Reference in New Issue
Block a user