summaryrefslogtreecommitdiff
path: root/entropy.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-08-06 16:51:49 +1000
committerDamien Miller <djm@mindrot.org>2001-08-06 16:51:49 +1000
commit2ab5924d1fd11233b50714ef40384a62e1f6740a (patch)
treea55295ab28d63d59bf7aeeb61efe758b512f5183 /entropy.c
parente26a155415ffb384fd95296b2ed9e129169abd10 (diff)
downloadopenssh-git-2ab5924d1fd11233b50714ef40384a62e1f6740a.tar.gz
- (djm) Fix interrupted read in entropy gatherer. Spotted by markus@ on
a fast UltraSPARC.
Diffstat (limited to 'entropy.c')
-rw-r--r--entropy.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/entropy.c b/entropy.c
index 554a72b0..d9760cc1 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;