From 513ee0af0333981bbfeb29ee6711f3a2b5ea6496 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 23 Jan 2025 11:51:23 +0100 Subject: tools/syz-diff: prepare for moving to pkg/ Adjust the code to properly handle context cancellation. Replace log.Fatalf() by errors where it was straightforward. Decouple from the global variables. --- tools/syz-diff/patch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/syz-diff/patch.go') diff --git a/tools/syz-diff/patch.go b/tools/syz-diff/patch.go index 6bdcc8e1e..98a464ca0 100644 --- a/tools/syz-diff/patch.go +++ b/tools/syz-diff/patch.go @@ -14,12 +14,12 @@ import ( "github.com/google/syzkaller/pkg/vcs" ) -func extractModifiedFiles(cfg *mgrconfig.Config, data []byte) { +func PatchFocusAreas(cfg *mgrconfig.Config, gitPatch []byte) { const maxAffectedByHeader = 50 names := map[string]bool{} includedNames := map[string]bool{} - for _, file := range vcs.ParseGitDiff(data) { + for _, file := range vcs.ParseGitDiff(gitPatch) { names[file] = true if strings.HasSuffix(file, ".h") && cfg.KernelSrc != "" { -- cgit mrf-deployment