mirror of
https://github.com/restic/restic.git
synced 2026-03-05 14:16:24 +00:00
Add more error reporting
This commit is contained in:
@@ -11,10 +11,10 @@ import (
|
||||
"github.com/restic/restic/debug"
|
||||
)
|
||||
|
||||
func (node *Node) fill_extra(path string, fi os.FileInfo) (err error) {
|
||||
func (node *Node) fill_extra(path string, fi os.FileInfo) error {
|
||||
stat, ok := fi.Sys().(*syscall.Stat_t)
|
||||
if !ok {
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
node.ChangeTime = time.Unix(stat.Ctim.Unix())
|
||||
@@ -23,7 +23,7 @@ func (node *Node) fill_extra(path string, fi os.FileInfo) (err error) {
|
||||
node.GID = stat.Gid
|
||||
|
||||
// TODO: cache uid lookup
|
||||
if u, nil := user.LookupId(strconv.Itoa(int(stat.Uid))); err == nil {
|
||||
if u, err := user.LookupId(strconv.Itoa(int(stat.Uid))); err == nil {
|
||||
node.User = u.Username
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ func (node *Node) fill_extra(path string, fi os.FileInfo) (err error) {
|
||||
|
||||
node.Inode = stat.Ino
|
||||
|
||||
var err error
|
||||
|
||||
switch node.Type {
|
||||
case "file":
|
||||
node.Size = uint64(stat.Size)
|
||||
|
||||
Reference in New Issue
Block a user