Skip to content

Commit

Permalink
syscall: return pointer from test function OrigRlimitNofile
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ianlancetaylor authored and gopherbot committed Oct 3, 2023
1 parent f79c99f commit 638e0d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/syscall/exec_unix_test.go
Expand Up @@ -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")
}

Expand Down
7 changes: 2 additions & 5 deletions src/syscall/export_rlimit_test.go
Expand Up @@ -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()
}

0 comments on commit 638e0d3

Please sign in to comment.