mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 15:20:56 +00:00
Don't chmod in Atomic on android (fixes #2472)
This commit is contained in:
parent
321ef9816c
commit
f062e35641
@ -37,11 +37,14 @@ func CreateAtomic(path string, mode os.FileMode) (*AtomicWriter, error) {
|
|||||||
return nil, err
|
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 {
|
if err := os.Chmod(fd.Name(), mode); err != nil {
|
||||||
fd.Close()
|
fd.Close()
|
||||||
os.Remove(fd.Name())
|
os.Remove(fd.Name())
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
w := &AtomicWriter{
|
w := &AtomicWriter{
|
||||||
path: path,
|
path: path,
|
||||||
|
Loading…
Reference in New Issue
Block a user