]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: remove sysctl workaround for openbsd
authorJoel Sing <jsing@google.com>
Thu, 26 Apr 2012 15:45:15 +0000 (01:45 +1000)
committerJoel Sing <jsing@google.com>
Thu, 26 Apr 2012 15:45:15 +0000 (01:45 +1000)
Now that Go will no longer work on OpenBSD versions prior to 5.1,
remove the sysctl workaround that was needed for 5.0 and earlier.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6116050

src/pkg/syscall/syscall_bsd.go

index c1a822aa17a04437262334710824ff4754f1a5bd..8269286daf9212d30220161dde476ddacbaa30f0 100644 (file)
@@ -13,7 +13,6 @@
 package syscall
 
 import (
-       "runtime"
        "unsafe"
 )
 
@@ -553,16 +552,7 @@ func Sysctl(name string) (value string, err error) {
                return "", err
        }
        if n == 0 {
-               // TODO(jsing): Remove after OpenBSD 5.2 release.
-               // 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 runtime.GOOS == "openbsd" && (name == "kern.hostname" || name == "kern.domainname") {
-                       // MAXHOSTNAMELEN
-                       n = 256
-               } else {
-                       return "", nil
-               }
+               return "", nil
        }
 
        // Read into buffer of that size.