diff options
Diffstat (limited to 'src/crypto/rand/rand_getentropy.go')
-rw-r--r-- | src/crypto/rand/rand_getentropy.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crypto/rand/rand_getentropy.go b/src/crypto/rand/rand_getentropy.go index dd725372ad..b1c19f3d0d 100644 --- a/src/crypto/rand/rand_getentropy.go +++ b/src/crypto/rand/rand_getentropy.go @@ -15,7 +15,7 @@ func init() { altGetRandom = getEntropy } -func getEntropy(p []byte) (ok bool) { +func getEntropy(p []byte) error { // getentropy(2) returns a maximum of 256 bytes per call for i := 0; i < len(p); i += 256 { end := i + 256 @@ -24,8 +24,8 @@ func getEntropy(p []byte) (ok bool) { } err := unix.GetEntropy(p[i:end]) if err != nil { - return false + return err } } - return true + return nil } |