Skip to content

Commit 12bd244

Browse files
ianlancetaylorgopherbot
authored andcommitted
runtime2: don't check fcntl errno in checkfds on AIX and Solaris
On AIX and Solaris the errno value is fetched using m.mOS.perrno. When checkfds is called, that value has not yet been set up by minit. Since the error value doesn't really matter in checkfds, don't bother to check it on AIX and Solaris. Fixes #61584 Change-Id: I4e679ee3fdad4f0b833ae102597b2d6b8cb46cb6 Reviewed-on: https://go-review.googlesource.com/c/go/+/513215 Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]>
1 parent 09c886d commit 12bd244

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/runtime/fds_unix.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ func checkfds() {
2828
if ret >= 0 {
2929
continue
3030
}
31+
32+
// On AIX and Solaris we can't get the right errno
33+
// value this early in program startup,
34+
// because we haven't yet called minit
35+
// which sets m.mOS.perrno.
36+
// Just assume that the error is EBADF.
37+
if GOOS == "aix" || GOOS == "solaris" {
38+
errno = EBADF
39+
}
40+
3141
if errno != EBADF {
3242
print("runtime: unexpected error while checking standard file descriptor ", i, ", errno=", errno, "\n")
3343
throw("cannot open standard fds")

0 commit comments

Comments
 (0)