local: Ignore additional errors for directory syncing

Apparently SMB/CIFS on Linux/macOS returns somewhat random errnos when
trying to sync a windows share which does not support calling fsync for
a directory.
This commit is contained in:
Michael Eischer 2022-05-11 20:37:59 +02:00
parent ac36fda155
commit 48a0d83143
2 changed files with 14 additions and 1 deletions

View file

@ -19,7 +19,7 @@ func fsyncDir(dir string) error {
}
err = d.Sync()
if errors.Is(err, syscall.ENOTSUP) {
if errors.Is(err, syscall.ENOTSUP) || errors.Is(err, syscall.ENOENT) || errors.Is(err, syscall.EINVAL) {
err = nil
}