diff options
Diffstat (limited to 'src/lib/entropy/unix_procs')
-rw-r--r-- | src/lib/entropy/unix_procs/unix_procs.cpp | 8 | ||||
-rw-r--r-- | src/lib/entropy/unix_procs/unix_procs.h | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/entropy/unix_procs/unix_procs.cpp b/src/lib/entropy/unix_procs/unix_procs.cpp index f7583cf23..1cc93741c 100644 --- a/src/lib/entropy/unix_procs/unix_procs.cpp +++ b/src/lib/entropy/unix_procs/unix_procs.cpp @@ -213,9 +213,9 @@ void Unix_EntropySource::poll(Entropy_Accumulator& accum) const size_t MS_WAIT_TIME = 32; const double ENTROPY_ESTIMATE = 1.0 / 1024; - secure_vector<byte>& io_buffer = accum.get_io_buffer(4*1024); // page + m_buf.resize(4096); - while(!accum.polling_goal_achieved()) + while(!accum.polling_finished()) { while(m_procs.size() < m_concurrent) m_procs.emplace_back(Unix_Process(next_source())); @@ -253,9 +253,9 @@ void Unix_EntropySource::poll(Entropy_Accumulator& accum) if(FD_ISSET(fd, &read_set)) { - const ssize_t got = ::read(fd, &io_buffer[0], io_buffer.size()); + const ssize_t got = ::read(fd, &m_buf[0], m_buf.size()); if(got > 0) - accum.add(&io_buffer[0], got, ENTROPY_ESTIMATE); + accum.add(&m_buf[0], got, ENTROPY_ESTIMATE); else proc.spawn(next_source()); } diff --git a/src/lib/entropy/unix_procs/unix_procs.h b/src/lib/entropy/unix_procs/unix_procs.h index eb798b207..cf6a8bb7d 100644 --- a/src/lib/entropy/unix_procs/unix_procs.h +++ b/src/lib/entropy/unix_procs/unix_procs.h @@ -75,6 +75,7 @@ class Unix_EntropySource : public EntropySource size_t m_sources_idx = 0; std::vector<Unix_Process> m_procs; + secure_vector<byte> m_buf; }; class UnixProcessInfo_EntropySource : public EntropySource |