From 80b027f830ba5d9e5bf2514462208fcea573c388 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 1 Jun 2016 20:07:43 +0200 Subject: nametransform, main: better error messages --- internal/nametransform/names_diriv.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/nametransform') diff --git a/internal/nametransform/names_diriv.go b/internal/nametransform/names_diriv.go index 1beda3f..f5aa88d 100644 --- a/internal/nametransform/names_diriv.go +++ b/internal/nametransform/names_diriv.go @@ -37,7 +37,8 @@ func ReadDirIV(dir string) (iv []byte, err error) { func ReadDirIVAt(dirfd *os.File) (iv []byte, err error) { fdRaw, err := syscall.Openat(int(dirfd.Fd()), DirIVFilename, syscall.O_RDONLY, 0) if err != nil { - toggledlog.Warn.Printf("ReadDirIVAt: %v", err) + toggledlog.Warn.Printf("ReadDirIVAt: opening %q in dir %q failed: %v", + DirIVFilename, dirfd.Name(), err) return nil, err } fd := os.NewFile(uintptr(fdRaw), DirIVFilename) @@ -46,7 +47,7 @@ func ReadDirIVAt(dirfd *os.File) (iv []byte, err error) { iv = make([]byte, dirIVLen+1) n, err := fd.Read(iv) if err != nil { - toggledlog.Warn.Printf("ReadDirIVAt: %v", err) + toggledlog.Warn.Printf("ReadDirIVAt: Read failed: %v", err) return nil, err } iv = iv[0:n] -- cgit v1.2.3