]> andersk Git - openssh.git/blobdiff - entropy.c
- (djm) Avoid SIGCHLD breakage when run from rsync. Fix from
[openssh.git] / entropy.c
index d682450449bbbec29ec06d8e50991a348d5a02de..f31395947503aae21b2de1889bdff12b11bf3663 100644 (file)
--- a/entropy.c
+++ b/entropy.c
@@ -61,6 +61,7 @@ seed_rng(void)
        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 @@ seed_rng(void)
        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 @@ seed_rng(void)
        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) && 
This page took 0.043183 seconds and 4 git commands to generate.