From f8b50c193fc5cf4062532c2984f7358445441a0c Mon Sep 17 00:00:00 2001 From: Michael Graff Date: Fri, 9 Jun 2000 22:24:22 +0000 Subject: [PATCH] snapshot --- bin/tests/entropy_test.c | 3 +-- lib/isc/include/isc/entropy.h | 6 ------ lib/isc/unix/entropy.c | 5 +---- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/bin/tests/entropy_test.c b/bin/tests/entropy_test.c index 2c11d8e418..113fd6eea3 100644 --- a/bin/tests/entropy_test.c +++ b/bin/tests/entropy_test.c @@ -71,10 +71,9 @@ main(int argc, char **argv) { isc_entropy_stats(ent, stderr); -#if 1 +#if 0 devrandom = NULL; flags = 0; - flags |= ISC_ENTROPYSOURCE_ISDEVICE; CHECK("isc_entropy_createfilesource()", isc_entropy_createfilesource(ent, "/dev/random", flags, &devrandom)); diff --git a/lib/isc/include/isc/entropy.h b/lib/isc/include/isc/entropy.h index 83aef83280..7cd72f6ac9 100644 --- a/lib/isc/include/isc/entropy.h +++ b/lib/isc/include/isc/entropy.h @@ -97,14 +97,8 @@ ISC_LANG_BEGINDECLS * If this is not set, the source will be gathered and perodically * mixed into the entropy pool, but no increment in contained entropy * will be assumed. This flag only makes sense on sample sources. - * - * _ISDEVICE - * The file named is really a device file, and blocking is possible. - * Otherwise, the file is assumed to be a finite length file, and - * any I/O error (including blocking) terminates the source. */ #define ISC_ENTROPYSOURCE_ESTIMATE 0x00000001U -#define ISC_ENTROPYSOURCE_ISDEVICE 0x00000002U /*** *** Functions diff --git a/lib/isc/unix/entropy.c b/lib/isc/unix/entropy.c index 749dd70076..5786fa0d9f 100644 --- a/lib/isc/unix/entropy.c +++ b/lib/isc/unix/entropy.c @@ -278,13 +278,10 @@ get_from_filesource(isc_entropysource_t *source, isc_uint32_t desired) { int fd = source->sources.file.fd; ssize_t n, ndesired; isc_uint32_t added; - isc_boolean_t isdevice; if (fd == -1) return (0); - isdevice = ISC_TF((source->flags & ISC_ENTROPYSOURCE_ISDEVICE) != 0); - desired = desired / 8 + (((desired & 0x07) > 0) ? 1 : 0); added = 0; @@ -292,7 +289,7 @@ get_from_filesource(isc_entropysource_t *source, isc_uint32_t desired) { ndesired = ISC_MIN(desired, sizeof(buf)); n = read(fd, buf, ndesired); if (n < 0) { - if (isdevice && (errno == EAGAIN)) + if (errno == EAGAIN) goto out; close(fd); source->sources.file.fd = -1;