diff options
author | 2005-01-27 18:18:20 +0000 | |
---|---|---|
committer | 2005-01-27 18:18:20 +0000 | |
commit | 204669f1feb4d36259f8c9dd7e36de1b51eac944 (patch) | |
tree | fecb8e8f1e71be6a8306727e3da2530dee5758ac | |
parent | In randompoll() the write check was overriding the results of the read check. (diff) | |
download | wireguard-openbsd-204669f1feb4d36259f8c9dd7e36de1b51eac944.tar.xz wireguard-openbsd-204669f1feb4d36259f8c9dd7e36de1b51eac944.zip |
poll can ever deny reads for srandom only; millert@ ok
-rw-r--r-- | sys/dev/rnd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index afdbe8ccbd6..61d64b3a05c 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.74 2005/01/27 18:12:32 millert Exp $ */ +/* $OpenBSD: rnd.c,v 1.75 2005/01/27 18:18:20 mickey Exp $ */ /* * rnd.c -- A strong random number generator @@ -1045,10 +1045,10 @@ randompoll(dev, events, p) revents = events & (POLLOUT | POLLWRNORM); /* always writable */ if (events & (POLLIN | POLLRDNORM)) { - if (random_state.entropy_count > 0) - revents |= events & (POLLIN | POLLRDNORM); - else + if (minor(dev) == RND_SRND && random_state.entropy_count <= 0) selrecord(p, &rnd_rsel); + else + revents |= events & (POLLIN | POLLRDNORM); } return (revents); |