mirror of
https://github.com/restic/rest-server.git
synced 2025-10-19 15:43:21 +00:00

This ignores several different combinations of errnos which are returned if the storage destination is not able to fsync correctly. See also https://github.com/restic/restic/pull/4021
19 lines
417 B
Go
19 lines
417 B
Go
//go:build !windows
|
|
// +build !windows
|
|
|
|
package repo
|
|
|
|
import (
|
|
"errors"
|
|
"runtime"
|
|
"syscall"
|
|
)
|
|
|
|
// The ExFAT driver on some versions of macOS can return ENOTTY,
|
|
// "inappropriate ioctl for device", for fsync.
|
|
//
|
|
// https://github.com/restic/restic/issues/4016
|
|
// https://github.com/realm/realm-core/issues/5789
|
|
func isMacENOTTY(err error) bool {
|
|
return runtime.GOOS == "darwin" && errors.Is(err, syscall.ENOTTY)
|
|
}
|