summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/rand/rand_unix.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-04-20 15:44:41 +0200
committerOndřej Surý <ondrej@sury.org>2011-04-20 15:44:41 +0200
commit50104cc32a498f7517a51c8dc93106c51c7a54b4 (patch)
tree47af80be259cc7c45d0eaec7d42e61fa38c8e4fb /src/pkg/crypto/rand/rand_unix.go
parentc072558b90f1bbedc2022b0f30c8b1ac4712538e (diff)
downloadgolang-50104cc32a498f7517a51c8dc93106c51c7a54b4.tar.gz
Imported Upstream version 2011.03.07.1upstream/2011.03.07.1
Diffstat (limited to 'src/pkg/crypto/rand/rand_unix.go')
-rw-r--r--src/pkg/crypto/rand/rand_unix.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pkg/crypto/rand/rand_unix.go b/src/pkg/crypto/rand/rand_unix.go
index 900b57330..66b72c076 100644
--- a/src/pkg/crypto/rand/rand_unix.go
+++ b/src/pkg/crypto/rand/rand_unix.go
@@ -8,6 +8,7 @@
package rand
import (
+ "bufio"
"crypto/aes"
"io"
"os"
@@ -23,7 +24,7 @@ func init() { Reader = &devReader{name: "/dev/urandom"} }
// A devReader satisfies reads by reading the file named name.
type devReader struct {
name string
- f *os.File
+ f io.Reader
mu sync.Mutex
}
@@ -35,7 +36,7 @@ func (r *devReader) Read(b []byte) (n int, err os.Error) {
if f == nil {
return 0, err
}
- r.f = f
+ r.f = bufio.NewReader(f)
}
return r.f.Read(b)
}