Commit 595efd0d authored by Joel Sing's avatar Joel Sing Committed by Andrew Gerrand

syscall: fix openbsd sysctl hostname/domainname workaround

Fixes #2509.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5451055
parent 07ee3cc7
......@@ -563,7 +563,7 @@ func Sysctl(name string) (value string, err error) {
// Work around a bug that was fixed after OpenBSD 5.0.
// The length for kern.hostname and kern.domainname is always
// returned as 0 when a nil value is passed for oldp.
if OS == "openbsd" && (value == "kern.hostname" || value == "kern.domainname") {
if OS == "openbsd" && (name == "kern.hostname" || name == "kern.domainname") {
// MAXHOSTNAMELEN
n = 256
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment