1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-16 00:00:05 +01:00

changed stat call

This commit is contained in:
jgfrm 2017-02-06 21:03:47 +01:00
parent 685d1bb8aa
commit 65a3069180
4 changed files with 6 additions and 7 deletions

View file

@ -47,9 +47,9 @@ func (e *dirEntry) equals(other *dirEntry) bool {
}
func nlink(info os.FileInfo) (uint64, error) {
stat, err := restic.ToStatT(info.Sys())
stat, err := info.Sys().(*syscall.Stat_t)
if err {
return 0, err
}
return stat.Nlink(info), err
return stat.nlink, err
}

View file

@ -409,7 +409,7 @@ func (node *Node) IsNewer(path string, fi os.FileInfo) bool {
size := uint64(fi.Size())
extendedStat, ok := ToStatT(fi.Sys())
extendedStat, ok := toStatT(fi.Sys())
if !ok {
if node.ModTime != fi.ModTime() ||
node.Size != size {
@ -475,7 +475,7 @@ func lookupUsername(uid string) (string, error) {
}
func (node *Node) fillExtra(path string, fi os.FileInfo) error {
stat, ok := ToStatT(fi.Sys())
stat, ok := toStatT(fi.Sys())
if !ok {
return nil
}

View file

@ -12,8 +12,7 @@ var lchown = os.Lchown
type statUnix syscall.Stat_t
//ToStatT call the unix system call stat.
func ToStatT(i interface{}) (statT, bool) {
func toStatT(i interface{}) (statT, bool) {
if i == nil {
return nil, false
}

View file

@ -25,7 +25,7 @@ func (node Node) restoreSymlinkTimestamps(path string, utimes [2]syscall.Timespe
type statWin syscall.Win32FileAttributeData
//ToStatT call the Windows system call Win32FileAttributeData.
func ToStatT(i interface{}) (statT, bool) {
func toStatT(i interface{}) (statT, bool) {
if i == nil {
return nil, false
}