From ee108603572101ad3c285830e04ee248916b6c5d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 17 Mar 2025 01:09:12 +0900 Subject: seccomp: install output atomically Signed-off-by: Ophestra --- seccomp/export_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'seccomp/export_test.go') diff --git a/seccomp/export_test.go b/seccomp/export_test.go index 991517f4..34bb306b 100644 --- a/seccomp/export_test.go +++ b/seccomp/export_test.go @@ -4,7 +4,6 @@ import ( "crypto/sha512" "errors" "io" - "log" "slices" "syscall" "testing" @@ -79,8 +78,9 @@ func TestExport(t *testing.T) { buf := make([]byte, 8) for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - seccomp.CPrintln = log.Println - t.Cleanup(func() { seccomp.CPrintln = nil }) + oldF := seccomp.GetOutput() + seccomp.SetOutput(t.Log) + t.Cleanup(func() { seccomp.SetOutput(oldF) }) e := seccomp.New(tc.opts) digest := sha512.New() -- cgit v1.3.1