Skip to content

Commit 638e0d3

Browse files
ianlancetaylorgopherbot
authored andcommitted
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 <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Michael Pratt <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent f79c99f commit 638e0d3

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/syscall/exec_unix_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ func TestRlimitRestored(t *testing.T) {
357357
}
358358

359359
orig := syscall.OrigRlimitNofile()
360-
if orig.Cur == 0 {
360+
if orig == nil {
361361
t.Skip("skipping test because rlimit not adjusted at startup")
362362
}
363363

src/syscall/export_rlimit_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
package syscall
88

9-
func OrigRlimitNofile() Rlimit {
10-
if rlim := origRlimitNofile.Load(); rlim != nil {
11-
return *rlim
12-
}
13-
return Rlimit{0, 0}
9+
func OrigRlimitNofile() *Rlimit {
10+
return origRlimitNofile.Load()
1411
}

0 commit comments

Comments
 (0)