From c22a0c12e49181d6ea042993e6b4b47db69574b1 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 18 Apr 2006 15:16:24 +0000 Subject: Make the probe for RNG sources at runtime since the configure script isn't compatible with cross-compiling. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@744 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/daemon/main.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'src/daemon') diff --git a/src/daemon/main.c b/src/daemon/main.c index d783531a..4ae9fbf1 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -63,6 +63,7 @@ #include #include #include +#include #include "cmdline.h" #include "cpulimit.h" @@ -135,29 +136,6 @@ static void close_pipe(int p[2]) { p[0] = p[1] = -1; } -static void set_random_seed(void) { - unsigned int seed = 0; - -#ifdef RANDOM_DEVICE - int fd; - - if ((fd = open(RANDOM_DEVICE, O_RDONLY)) >= 0) { - ssize_t r; - - if ((r = pa_loop_read(fd, &seed, sizeof(seed))) < 0 || (size_t) r != sizeof(seed)) { - pa_log_error(__FILE__": failed to read entropy from '"RANDOM_DEVICE"'"); - seed += (unsigned int) time(NULL); - } - - close(fd); - } -#else - seed = (unsigned int) time(NULL); -#endif - - srand(seed); -} - int main(int argc, char *argv[]) { pa_core *c; pa_strbuf *buf = NULL; @@ -203,7 +181,7 @@ int main(int argc, char *argv[]) { } #endif - set_random_seed(); + pa_random_seed(); pa_log_set_ident("polypaudio"); -- cgit