re PR go/52341 (crypto/rand FAILs before Solaris 11)

PR go/52341

crypto/rand: Use io.ReadFull when reading from /dev/urandom.

From-SVN: r186804
This commit is contained in:
Ian Lance Taylor 2012-04-25 04:41:13 +00:00
parent 8d717866ff
commit 3fef1872df
1 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@ package rand
import (
"bytes"
"compress/flate"
"io"
"testing"
)
@ -16,9 +17,9 @@ func TestRead(t *testing.T) {
n = 1e5
}
b := make([]byte, n)
n, err := Read(b)
n, err := io.ReadFull(Reader, b)
if n != len(b) || err != nil {
t.Fatalf("Read(buf) = %d, %s", n, err)
t.Fatalf("ReadFull(buf) = %d, %s", n, err)
}
var z bytes.Buffer