# define SAVED_IDS_WORK_WITH_SETEUID
#endif
-void check_openssl_version(void)
+static void
+check_openssl_version(void)
{
if (SSLeay() != OPENSSL_VERSION_NUMBER)
fatal("OpenSSL version mismatch. Built against %lx, you "
#ifdef USE_PRNGD
/* Collect entropy from PRNGD/EGD */
-int get_random_bytes(unsigned char *buf, int len)
+int
+get_random_bytes(unsigned char *buf, int len)
{
int fd;
char msg[2];
#else /* !USE_PRNGD */
#ifdef RANDOM_POOL
/* Collect entropy from /dev/urandom or pipe */
-int get_random_bytes(unsigned char *buf, int len)
+static int
+get_random_bytes(unsigned char *buf, int len)
{
int random_pool;
memset(buf, '\0', sizeof(buf));
}
-void init_rng(void)
+void
+init_rng(void)
{
check_openssl_version();
}
}
-static
-int
+static int
_get_timeval_msec_difference(struct timeval *t1, struct timeval *t2) {
int secdiff, usecdiff;
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;
/* commands */
old_sigchld_handler = mysignal(SIGCHLD, SIG_DFL);
- debug("Seeded RNG with %i bytes from programs", (int)stir_from_programs());
- debug("Seeded RNG with %i bytes from system calls", (int)stir_from_system());
+ debug("Seeded RNG with %i bytes from programs",
+ (int)stir_from_programs());
+ debug("Seeded RNG with %i bytes from system calls",
+ (int)stir_from_system());
if (!RAND_status())
fatal("Not enough entropy in RNG");
fatal("Couldn't initialise builtin random number generator -- exiting.");
}
-void init_rng(void)
+void
+init_rng(void)
{
int original_euid;