]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: return pointer from test function OrigRlimitNofile
authorIan Lance Taylor <iant@golang.org>
Mon, 2 Oct 2023 23:26:27 +0000 (16:26 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 3 Oct 2023 16:01:10 +0000 (16:01 +0000)
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>
src/syscall/exec_unix_test.go
src/syscall/export_rlimit_test.go

index accf6cc5c517836c13b4d8302f1f16cc7dbc09dd..5584f7d4445b2a1470581a9fd32892b6d1d668ff 100644 (file)
@@ -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")
        }
 
index 25f0ef82c34a45ecba987a7fe0b5adce6071785c..8b1545cb0390985e364b3e2e98487211976add72 100644 (file)
@@ -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()
 }