diff options
Diffstat (limited to 'entropy.c')
-rw-r--r-- | entropy.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -45,7 +45,7 @@ | |||
45 | * XXX: we should tell the child how many bytes we need. | 45 | * XXX: we should tell the child how many bytes we need. |
46 | */ | 46 | */ |
47 | 47 | ||
48 | RCSID("$Id: entropy.c,v 1.44 2002/06/09 19:41:48 mouring Exp $"); | 48 | RCSID("$Id: entropy.c,v 1.46 2003/08/25 01:16:21 mouring Exp $"); |
49 | 49 | ||
50 | #ifndef OPENSSL_PRNG_ONLY | 50 | #ifndef OPENSSL_PRNG_ONLY |
51 | #define RANDOM_SEED_SIZE 48 | 51 | #define RANDOM_SEED_SIZE 48 |
@@ -75,7 +75,7 @@ seed_rng(void) | |||
75 | if (pipe(p) == -1) | 75 | if (pipe(p) == -1) |
76 | fatal("pipe: %s", strerror(errno)); | 76 | fatal("pipe: %s", strerror(errno)); |
77 | 77 | ||
78 | old_sigchld = mysignal(SIGCHLD, SIG_DFL); | 78 | old_sigchld = signal(SIGCHLD, SIG_DFL); |
79 | if ((pid = fork()) == -1) | 79 | if ((pid = fork()) == -1) |
80 | fatal("Couldn't fork: %s", strerror(errno)); | 80 | fatal("Couldn't fork: %s", strerror(errno)); |
81 | if (pid == 0) { | 81 | if (pid == 0) { |
@@ -89,8 +89,8 @@ seed_rng(void) | |||
89 | if (original_uid != original_euid && | 89 | if (original_uid != original_euid && |
90 | ( seteuid(getuid()) == -1 || | 90 | ( seteuid(getuid()) == -1 || |
91 | setuid(original_uid) == -1) ) { | 91 | setuid(original_uid) == -1) ) { |
92 | fprintf(stderr, "(rand child) setuid(%d): %s\n", | 92 | fprintf(stderr, "(rand child) setuid(%li): %s\n", |
93 | original_uid, strerror(errno)); | 93 | (long int)original_uid, strerror(errno)); |
94 | _exit(1); | 94 | _exit(1); |
95 | } | 95 | } |
96 | 96 | ||
@@ -116,7 +116,7 @@ seed_rng(void) | |||
116 | if (waitpid(pid, &ret, 0) == -1) | 116 | if (waitpid(pid, &ret, 0) == -1) |
117 | fatal("Couldn't wait for ssh-rand-helper completion: %s", | 117 | fatal("Couldn't wait for ssh-rand-helper completion: %s", |
118 | strerror(errno)); | 118 | strerror(errno)); |
119 | mysignal(SIGCHLD, old_sigchld); | 119 | signal(SIGCHLD, old_sigchld); |
120 | 120 | ||
121 | /* We don't mind if the child exits upon a SIGPIPE */ | 121 | /* We don't mind if the child exits upon a SIGPIPE */ |
122 | if (!WIFEXITED(ret) && | 122 | if (!WIFEXITED(ret) && |