mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 23:06:32 +00:00
Merge remote-tracking branch 'fw42/fix_noatime_permission'
This commit is contained in:
commit
2e46914d0c
@ -12,7 +12,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (node *Node) OpenForReading() (*os.File, error) {
|
func (node *Node) OpenForReading() (*os.File, error) {
|
||||||
return os.OpenFile(node.path, os.O_RDONLY|syscall.O_NOATIME, 0)
|
file, err := os.OpenFile(node.path, os.O_RDONLY|syscall.O_NOATIME, 0)
|
||||||
|
if os.IsPermission(err) {
|
||||||
|
return os.OpenFile(node.path, os.O_RDONLY, 0)
|
||||||
|
}
|
||||||
|
return file, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (node *Node) fillExtra(path string, fi os.FileInfo) error {
|
func (node *Node) fillExtra(path string, fi os.FileInfo) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user