diff --git a/CHANGES b/CHANGES index b730e0110c..aed9c0f095 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ + 639. [bug] Reading entropy from the keyboard would sometimes fail. + [RT #591] + 638. [port] lib/isc/random.c needed to explicitly include time.h explicitly to get a prototype for time() when pthreads was not being used. [RT #592] diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c index 1f4e92d367..1f5d4e52ab 100644 --- a/bin/dnssec/dnssectool.c +++ b/bin/dnssec/dnssectool.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssectool.c,v 1.25 2000/12/11 19:15:51 bwelling Exp $ */ +/* $Id: dnssectool.c,v 1.26 2000/12/27 00:11:23 bwelling Exp $ */ #include @@ -235,7 +235,7 @@ kbdget(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) { unsigned char c; if (!blocking) - return (ISC_R_NOENTROPY); + return (ISC_R_NOTBLOCKING); result = isc_keyboard_getchar(kbd, &c); if (result != ISC_R_SUCCESS) diff --git a/lib/isc/include/isc/result.h b/lib/isc/include/isc/result.h index fa979d8ccf..3f2f7c7c12 100644 --- a/lib/isc/include/isc/result.h +++ b/lib/isc/include/isc/result.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.h,v 1.52 2000/11/18 02:56:47 gson Exp $ */ +/* $Id: result.h,v 1.53 2000/12/27 00:11:25 bwelling Exp $ */ #ifndef ISC_RESULT_H #define ISC_RESULT_H 1 @@ -74,10 +74,11 @@ #define ISC_R_FAMILYNOSUPPORT 48 /* AF not supported */ #define ISC_R_BADHEX 49 /* bad hex encoding */ #define ISC_R_TOOMANYOPENFILES 50 /* too many open files */ +#define ISC_R_NOTBLOCKING 51 /* not blocking */ /* * Not a result code: the number of results. */ -#define ISC_R_NRESULTS 51 +#define ISC_R_NRESULTS 52 ISC_LANG_BEGINDECLS diff --git a/lib/isc/result.c b/lib/isc/result.c index ce27208eac..c0d116f4cd 100644 --- a/lib/isc/result.c +++ b/lib/isc/result.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.c,v 1.51 2000/12/06 00:30:07 tale Exp $ */ +/* $Id: result.c,v 1.52 2000/12/27 00:11:24 bwelling Exp $ */ #include @@ -88,7 +88,8 @@ static const char *text[ISC_R_NRESULTS] = { "address family mismatch", /* 47 */ "address family not supported", /* 48 */ "bad hex encoding", /* 49 */ - "too many open files" /* 50 */ + "too many open files", /* 50 */ + "not blocking" /* 51 */ }; #define ISC_RESULT_RESULTSET 2 diff --git a/lib/isc/unix/entropy.c b/lib/isc/unix/entropy.c index 61db8dce07..1cefc858d1 100644 --- a/lib/isc/unix/entropy.c +++ b/lib/isc/unix/entropy.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: entropy.c,v 1.53 2000/12/14 22:40:17 gson Exp $ */ +/* $Id: entropy.c,v 1.54 2000/12/27 00:11:26 bwelling Exp $ */ #include @@ -442,7 +442,8 @@ get_from_callback(isc_entropysource_t *source, unsigned int desired, added += got; desired -= ISC_MIN(got, desired); result = ISC_R_SUCCESS; - } else if (result != ISC_R_SUCCESS) + } else if (result != ISC_R_SUCCESS && + result != ISC_R_NOTBLOCKING) source->bad = ISC_TRUE; }