From 638e0d36d2a6b2efce0550978bf48e7df1166a0b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 2 Oct 2023 16:26:27 -0700 Subject: [PATCH] syscall: return pointer from test function OrigRlimitNofile Change-Id: I8740a2a7ebb3045d8daa97bcb0da7f31f6f7b881 Reviewed-on: https://go-review.googlesource.com/c/go/+/531996 LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor Reviewed-by: Michael Pratt Reviewed-by: Tobias Klauser Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/syscall/exec_unix_test.go | 2 +- src/syscall/export_rlimit_test.go | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/syscall/exec_unix_test.go b/src/syscall/exec_unix_test.go index accf6cc5c5..5584f7d444 100644 --- a/src/syscall/exec_unix_test.go +++ b/src/syscall/exec_unix_test.go @@ -357,7 +357,7 @@ func TestRlimitRestored(t *testing.T) { } orig := syscall.OrigRlimitNofile() - if orig.Cur == 0 { + if orig == nil { t.Skip("skipping test because rlimit not adjusted at startup") } diff --git a/src/syscall/export_rlimit_test.go b/src/syscall/export_rlimit_test.go index 25f0ef82c3..8b1545cb03 100644 --- a/src/syscall/export_rlimit_test.go +++ b/src/syscall/export_rlimit_test.go @@ -6,9 +6,6 @@ package syscall -func OrigRlimitNofile() Rlimit { - if rlim := origRlimitNofile.Load(); rlim != nil { - return *rlim - } - return Rlimit{0, 0} +func OrigRlimitNofile() *Rlimit { + return origRlimitNofile.Load() } -- 2.50.0