diff options
author | Ian Lance Taylor <iant@golang.org> | 2023-10-02 16:26:27 -0700 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2023-10-03 16:01:10 +0000 |
commit | 638e0d36d2a6b2efce0550978bf48e7df1166a0b (patch) | |
tree | 94bed72997c467b784bd65c8b69c88c1eddaf615 /src/syscall | |
parent | f79c99fe8ae4a5e4380af22ee6cb38c3eb3a0416 (diff) | |
download | go-638e0d36d2a6b2efce0550978bf48e7df1166a0b.tar.gz go-638e0d36d2a6b2efce0550978bf48e7df1166a0b.zip |
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/syscall')
-rw-r--r-- | src/syscall/exec_unix_test.go | 2 | ||||
-rw-r--r-- | 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() } |