mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
rand: fix compilation on linux
This commit is contained in:
parent
ca81442fac
commit
cd07429cc1
@ -18,7 +18,7 @@ pub fn read(bytes_needed int) ?[]byte {
|
|||||||
// getrandom syscall wont block if requesting <= 256 bytes
|
// getrandom syscall wont block if requesting <= 256 bytes
|
||||||
if bytes_needed > read_batch_size {
|
if bytes_needed > read_batch_size {
|
||||||
no_batches := int(math.floor(f64(bytes_needed/read_batch_size)))
|
no_batches := int(math.floor(f64(bytes_needed/read_batch_size)))
|
||||||
for i:=0; i<no_batches; i++ {
|
for i:=0; i < no_batches; i++ {
|
||||||
if getrandom(read_batch_size, buffer+bytes_read) == -1 {
|
if getrandom(read_batch_size, buffer+bytes_read) == -1 {
|
||||||
return read_error
|
return read_error
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user