backend/local: Ignore ENOTTY for fsync on Mac

Fixes #4016.
This commit is contained in:
greatroar 2022-11-11 14:53:42 +01:00 committed by Michael Eischer
parent 59a90943bb
commit 348e966daa
4 changed files with 25 additions and 2 deletions

View file

@ -177,7 +177,7 @@ func (b *Local) Save(ctx context.Context, h restic.Handle, rd restic.RewindReade
// Ignore error if filesystem does not support fsync.
err = f.Sync()
syncNotSup := errors.Is(err, syscall.ENOTSUP)
syncNotSup := err != nil && (errors.Is(err, syscall.ENOTSUP) || isMacENOTTY(err))
if err != nil && !syncNotSup {
return errors.WithStack(err)
}