summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-03-18 13:40:50 +0000
committergVisor bot <gvisor-bot@google.com>2020-03-18 13:40:50 +0000
commitc8f9c3923dd98a093e9e6f831012aaab40379fcb (patch)
tree91b7c82d77deba18e716211f9e5079225b7ab0c7 /pkg
parentbf6c168bd699b9852797af6a49964e87a9c78b50 (diff)
parentc29d4fc59eefefa71526daf030844a4b449c91b9 (diff)
Merge release-20200219.0-190-gc29d4fc (automated)
Diffstat (limited to 'pkg')
-rw-r--r--pkg/rand/rand_linux.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/pkg/rand/rand_linux.go b/pkg/rand/rand_linux.go
index 1aec96e2b..0bdad5fad 100644
--- a/pkg/rand/rand_linux.go
+++ b/pkg/rand/rand_linux.go
@@ -45,18 +45,12 @@ func (r *reader) Read(p []byte) (int, error) {
return rand.Read(p)
}
-// mu protects the global Reader below.
-var mu sync.Mutex
-
// Reader is the default reader.
var Reader io.Reader = &reader{}
// Read reads from the default reader.
func Read(b []byte) (int, error) {
- mu.Lock()
- n, err := io.ReadFull(Reader, b)
- mu.Unlock()
- return n, err
+ return io.ReadFull(Reader, b)
}
// Init can be called to make sure /dev/urandom is pre-opened on kernels that