diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2005-01-27 18:12:33 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2005-01-27 18:12:33 +0000 |
commit | 50b67ddbbbefc58dad57fbfb58fd3bc7e5940775 (patch) | |
tree | 14566b3a918a6cd4142b736c62f16a3dda4952ee /sys | |
parent | 036f6c6532a4efcdd2146bf0cb6faf2a8248c34b (diff) |
In randompoll() the write check was overriding the results of the read check.
OK mickey@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/rnd.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index fb4d7e98985..afdbe8ccbd6 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.73 2004/07/21 01:02:07 mickey Exp $ */ +/* $OpenBSD: rnd.c,v 1.74 2005/01/27 18:12:32 millert Exp $ */ /* * rnd.c -- A strong random number generator @@ -1041,16 +1041,15 @@ randompoll(dev, events, p) int events; struct proc *p; { - int revents = 0; + int revents; + revents = events & (POLLOUT | POLLWRNORM); /* always writable */ if (events & (POLLIN | POLLRDNORM)) { if (random_state.entropy_count > 0) revents |= events & (POLLIN | POLLRDNORM); else selrecord(p, &rnd_rsel); } - if (events & (POLLOUT | POLLWRNORM)) - revents = events & (POLLOUT | POLLWRNORM); /* always writable */ return (revents); } |