diff options
Diffstat (limited to 'sys/src/9/port/random.c')
-rw-r--r-- | sys/src/9/port/random.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/src/9/port/random.c b/sys/src/9/port/random.c index 3a697827a..f578d68cc 100644 --- a/sys/src/9/port/random.c +++ b/sys/src/9/port/random.c @@ -42,10 +42,11 @@ genrandom(void*) up->basepri = PriNormal; up->priority = up->basepri; + while(waserror()) + ; for(;;){ - for(;;) - if(++rb.randomcount > 100000) - break; + if(++rb.randomcount <= 100000) + continue; if(anyhigher()) sched(); if(!rbnotfull(0)) |