forked from TrueCloudLab/restic
Add more error reporting
This commit is contained in:
parent
865d315ad6
commit
aca0692ee6
2 changed files with 20 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue