|
@@ -12,9 +12,17 @@ package fs
|
|
import (
|
|
import (
|
|
"syscall"
|
|
"syscall"
|
|
"time"
|
|
"time"
|
|
|
|
+
|
|
|
|
+ "github.com/syncthing/syncthing/lib/build"
|
|
)
|
|
)
|
|
|
|
|
|
func (fi basicFileInfo) InodeChangeTime() time.Time {
|
|
func (fi basicFileInfo) InodeChangeTime() time.Time {
|
|
|
|
+ // On Android, mtime and inode-change-time fluctuate, which can cause
|
|
|
|
+ // conflicts even when nothing has been modified on the device itself.
|
|
|
|
+ // Ref: https://forum.syncthing.net/t/keep-getting-conflicts-generated-on-android-device-for-files-modified-only-on-a-desktop-pc/19060
|
|
|
|
+ if build.IsAndroid {
|
|
|
|
+ return time.Time{}
|
|
|
|
+ }
|
|
if sys, ok := fi.FileInfo.Sys().(*syscall.Stat_t); ok {
|
|
if sys, ok := fi.FileInfo.Sys().(*syscall.Stat_t); ok {
|
|
return time.Unix(0, sys.Ctim.Nano())
|
|
return time.Unix(0, sys.Ctim.Nano())
|
|
}
|
|
}
|