diff options
| author | Joel Sing <jsing@google.com> | 2013-10-07 09:21:33 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2013-10-07 09:21:33 -0700 |
| commit | fc1bea321de31243c2f68316941e0f99eeb86557 (patch) | |
| tree | 3c424c9bc70e4fef6003811f43f06f99180cb135 /src/pkg/os | |
| parent | fba015ecb415ecd84b2d2e2c98f1a6efc09fbd5b (diff) | |
| download | go-fc1bea321de31243c2f68316941e0f99eeb86557.tar.xz | |
os/user: fix user lookups on dragonfly
Like FreeBSD, DragonFly does not provide a sysconf value for
_SC_GETPW_R_SIZE_MAX.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14469043
Diffstat (limited to 'src/pkg/os')
| -rw-r--r-- | src/pkg/os/user/lookup_unix.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/os/user/lookup_unix.go b/src/pkg/os/user/lookup_unix.go index e709f7e521..5459268fa0 100644 --- a/src/pkg/os/user/lookup_unix.go +++ b/src/pkg/os/user/lookup_unix.go @@ -50,10 +50,10 @@ func lookupUnix(uid int, username string, lookupByName bool) (*User, error) { var result *C.struct_passwd var bufSize C.long - if runtime.GOOS == "freebsd" { - // FreeBSD doesn't have _SC_GETPW_R_SIZE_MAX - // and just returns -1. So just use the same - // size that Linux returns + if runtime.GOOS == "dragonfly" || runtime.GOOS == "freebsd" { + // DragonFly and FreeBSD do not have _SC_GETPW_R_SIZE_MAX + // and just return -1. So just use the same + // size that Linux returns. bufSize = 1024 } else { bufSize = C.sysconf(C._SC_GETPW_R_SIZE_MAX) |
