diff options
-rw-r--r-- | src/entropy/dev_random/es_dev.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/entropy/dev_random/es_dev.cpp b/src/entropy/dev_random/es_dev.cpp index e6033753d..ef3074194 100644 --- a/src/entropy/dev_random/es_dev.cpp +++ b/src/entropy/dev_random/es_dev.cpp @@ -40,8 +40,9 @@ u32bit Device_EntropySource::Device_Reader::get(byte out[], u32bit length, FD_SET(fd, &read_set); struct ::timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = ms_wait_time * 1000; + + timeout.tv_sec = (ms_wait_time / 1000); + timeout.tv_usec = (ms_wait_time % 1000) * 1000; if(::select(fd + 1, &read_set, 0, 0, &timeout) < 0) return 0; |