diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2011-01-08 02:22:44 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2011-01-08 02:22:44 +0000 |
commit | af8d860da4c669de565c21bc915198df2398937a (patch) | |
tree | 8ad8b538ea050f0805b07cb03aa161604a5a9093 /sys/dev/rnd.c | |
parent | 4266a340480e27258cc6575570db59331a2beaa4 (diff) |
switch back from PAGE_SIZE for the sake of sparc
Diffstat (limited to 'sys/dev/rnd.c')
-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 0575762cfce..63f5ff0c53c 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.128 2011/01/08 00:55:30 tedu Exp $ */ +/* $OpenBSD: rnd.c,v 1.129 2011/01/08 02:22:43 deraadt Exp $ */ /* * Copyright (c) 2011 Theo de Raadt. @@ -719,7 +719,7 @@ randomread(dev_t dev, struct uio *uio, int ioflag) if (uio->uio_resid == 0) return 0; - buf = malloc(2 * PAGE_SIZE, M_TEMP, M_WAITOK); + buf = malloc(POOLBYTES, M_TEMP, M_WAITOK); if (total > ARC4_MAIN_MAX_BYTES) { arc4random_buf(lbuf, sizeof(lbuf)); rc4_keysetup(&lctx, lbuf, sizeof(lbuf)); @@ -729,7 +729,7 @@ randomread(dev_t dev, struct uio *uio, int ioflag) } while (ret == 0 && uio->uio_resid > 0) { - int n = min(2 * PAGE_SIZE, uio->uio_resid); + int n = min(POOLBYTES, uio->uio_resid); if (myctx) rc4_getbytes(&lctx, buf, n); @@ -741,7 +741,7 @@ randomread(dev_t dev, struct uio *uio, int ioflag) } if (myctx) bzero(&lctx, sizeof(lctx)); - bzero(buf, 2 * PAGE_SIZE); + bzero(buf, POOLBYTES); free(buf, M_TEMP); return ret; } |