2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00
This commit is contained in:
Michael Graff
2000-06-09 22:24:22 +00:00
parent 2003deb5d1
commit f8b50c193f
3 changed files with 2 additions and 12 deletions

View File

@@ -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;