diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2021-04-20 03:48:50 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2021-04-20 03:48:50 +0200 |
commit | 616119ee22fec0f0db7a4c89a6a8f649d5926891 (patch) | |
tree | 0b32171a1f16b389d80f050838aa52b5e38f0cce /opentracker.c | |
parent | 0695b488708f3beaa17456c2b132b211a6fb5332 (diff) |
Turn random() to nrand48 in inner loop where it is not cryptographically relevant to avoid futex storm. Thanks and credits to Bart Smienk
Diffstat (limited to 'opentracker.c')
-rw-r--r-- | opentracker.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/opentracker.c b/opentracker.c index aed8374..d2c0635 100644 --- a/opentracker.c +++ b/opentracker.c | |||
@@ -258,6 +258,9 @@ static void * server_mainloop( void * args ) { | |||
258 | #endif | 258 | #endif |
259 | if( !ws.inbuf || !ws.outbuf ) | 259 | if( !ws.inbuf || !ws.outbuf ) |
260 | panic( "Initializing worker failed" ); | 260 | panic( "Initializing worker failed" ); |
261 | ws.rand48_state[0] = (uint16_t)random(); | ||
262 | ws.rand48_state[1] = (uint16_t)random(); | ||
263 | ws.rand48_state[2] = (uint16_t)random(); | ||
261 | 264 | ||
262 | for( ; ; ) { | 265 | for( ; ; ) { |
263 | int64 sock; | 266 | int64 sock; |