mirror of
https://github.com/octoleo/restic.git
synced 2024-12-05 19:33:14 +00:00
8f20d5dcd5
Previously, nodeRestoreTimestamps would do something like if node.Type == restic.NodeTypeSymlink { return nodeRestoreSymlinkTimestamps(...) } return syscall.UtimesNano(...) where nodeRestoreSymlinkTimestamps was either a no-op or a reimplementation of syscall.UtimesNano that handles symlinks, with some repeated converting between timestamp types. The Linux implementation was a bit clumsy, requiring three syscalls to set the timestamps. In this new setup, there is a function utimesNano that has three implementations: * on Linux, it's a modified syscall.UtimesNano that uses AT_SYMLINK_NOFOLLOW and AT_FDCWD so it can handle any type in a single call; * on other Unix platforms, it just calls the syscall function after skipping symlinks; * on Windows, it's the modified UtimesNano that was previously called nodeRestoreSymlinkTimestamps, except with different arguments.
27 lines
777 B
Go
27 lines
777 B
Go
//go:build aix
|
|
// +build aix
|
|
|
|
package fs
|
|
|
|
import "github.com/restic/restic/internal/restic"
|
|
|
|
// nodeRestoreExtendedAttributes is a no-op on AIX.
|
|
func nodeRestoreExtendedAttributes(_ *restic.Node, _ string) error {
|
|
return nil
|
|
}
|
|
|
|
// nodeFillExtendedAttributes is a no-op on AIX.
|
|
func nodeFillExtendedAttributes(_ *restic.Node, _ string, _ bool) error {
|
|
return nil
|
|
}
|
|
|
|
// nodeRestoreGenericAttributes is no-op on AIX.
|
|
func nodeRestoreGenericAttributes(node *restic.Node, _ string, warn func(msg string)) error {
|
|
return restic.HandleAllUnknownGenericAttributesFound(node.GenericAttributes, warn)
|
|
}
|
|
|
|
// nodeFillGenericAttributes is a no-op on AIX.
|
|
func nodeFillGenericAttributes(_ *restic.Node, _ string, _ *ExtendedFileInfo) (allowExtended bool, err error) {
|
|
return true, nil
|
|
}
|