- (djm) Avoid SIGCHLD breakage when run from rsync. Fix from
   Sturle Sunde <sturle.sunde@usit.uio.no>
diff --git a/entropy.c b/entropy.c
index 8f6ab0e..84c15eb 100644
--- a/entropy.c
+++ b/entropy.c
@@ -45,7 +45,7 @@
  * XXX: we should tell the child how many bytes we need.
  */
 
-RCSID("$Id: entropy.c,v 1.41 2002/03/11 00:16:35 stevesk Exp $");
+RCSID("$Id: entropy.c,v 1.42 2002/04/18 12:53:27 djm Exp $");
 
 #ifndef OPENSSL_PRNG_ONLY
 #define RANDOM_SEED_SIZE 48
@@ -61,6 +61,7 @@
 	pid_t pid;
 	int ret;
 	unsigned char buf[RANDOM_SEED_SIZE];
+	mysig_t old_sigchld;
 
 	if (RAND_status() == 1) {
 		debug3("RNG is ready, skipping seeding");
@@ -74,6 +75,7 @@
 	if (pipe(p) == -1)
 		fatal("pipe: %s", strerror(errno));
 
+	old_sigchld = mysignal(SIGCHLD, SIG_DFL);
 	if ((pid = fork()) == -1)
 		fatal("Couldn't fork: %s", strerror(errno));
 	if (pid == 0) {
@@ -113,6 +115,7 @@
 	if (waitpid(pid, &ret, 0) == -1)
 	       fatal("Couldn't wait for ssh-rand-helper completion: %s", 
 	           strerror(errno));
+	mysignal(SIGCHLD, old_sigchld);
 
 	/* We don't mind if the child exits upon a SIGPIPE */
 	if (!WIFEXITED(ret) &&