From a1990d2bd9d1f54baf83802e2874069ee73b4fa4 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 25 Nov 2024 11:55:37 +0100 Subject: tools/syz-declextract: accept manager config Make the tool accept a manager config. This will be required for dynamic extraction of info from the kernel. --- pkg/osutil/osutil.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pkg/osutil') diff --git a/pkg/osutil/osutil.go b/pkg/osutil/osutil.go index 465679ced..3c98a7f68 100644 --- a/pkg/osutil/osutil.go +++ b/pkg/osutil/osutil.go @@ -333,10 +333,13 @@ func Abs(path string) string { if wd1, err := os.Getwd(); err == nil && wd1 != wd { panic(fmt.Sprintf("wd changed: %q -> %q", wd, wd1)) } - if path == "" || filepath.IsAbs(path) { + if path == "" { return path } - return filepath.Join(wd, path) + if !filepath.IsAbs(path) { + path = filepath.Join(wd, path) + } + return filepath.Clean(path) } // MonotonicNano returns monotonic time in nanoseconds from some unspecified point in time. -- cgit mrf-deployment