From b2cec31b341f7e8e6dffed0f4a5485b3a483257f Mon Sep 17 00:00:00 2001 From: trawick Date: Fri, 13 Sep 2002 15:43:30 +0000 Subject: PR: Fix a broken check for a failure to read from the random device file. PR: 12615 Submitted by: tenthumbs@cybernex.net git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63865 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/rand.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'misc') diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 94970dccb..b44a3f964 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -85,15 +85,20 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, { #ifdef DEV_RANDOM - int rnd; + int rnd, rc; apr_size_t got, tot; if ((rnd = open(STR(DEV_RANDOM), O_RDONLY)) == -1) return errno; - for (tot=0; tot