From 2ab5924d1fd11233b50714ef40384a62e1f6740a Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 6 Aug 2001 16:51:49 +1000 Subject: - (djm) Fix interrupted read in entropy gatherer. Spotted by markus@ on a fast UltraSPARC. --- ChangeLog | 6 +++++- entropy.c | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed6c3308a..f683a86f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20010803 + - (djm) Fix interrupted read in entropy gatherer. Spotted by markus@ on + a fast UltraSPARC. + 20010726 - (stevesk) use mysignal() in protocol 1 loop now that the SIGCHLD handler has converged. @@ -6103,4 +6107,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1424 2001/07/26 17:51:49 stevesk Exp $ +$Id: ChangeLog,v 1.1425 2001/08/06 06:51:49 djm Exp $ diff --git a/entropy.c b/entropy.c index 554a72b0d..d9760cc1d 100644 --- a/entropy.c +++ b/entropy.c @@ -40,7 +40,7 @@ #include "pathnames.h" #include "log.h" -RCSID("$Id: entropy.c,v 1.37 2001/06/27 13:36:08 djm Exp $"); +RCSID("$Id: entropy.c,v 1.38 2001/08/06 06:51:49 djm Exp $"); #ifndef offsetof # define offsetof(type, member) ((size_t) &((type *)0)->member) @@ -505,7 +505,9 @@ hash_output_from_command(entropy_source_t *src, char *hash) break; case 1: /* command input */ - bytes_read = read(p[0], buf, sizeof(buf)); + do { + bytes_read = read(p[0], buf, sizeof(buf)); + } while (bytes_read == -1 && errno == EINTR); RAND_add(&bytes_read, sizeof(&bytes_read), 0.0); if (bytes_read == -1) { error_abort = 1; -- cgit v1.2.3