diff --git a/daemon/main.c b/daemon/main.c index fc058abcb..6c7266196 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include "poller.h" #include "control_tcp.h" @@ -325,6 +327,11 @@ static void wpidfile(void) { static void init_everything() { + struct timespec ts; + + clock_gettime(CLOCK_REALTIME, &ts); + srandom(ts.tv_sec ^ ts.tv_nsec); + #if !GLIB_CHECK_VERSION(2,32,0) g_thread_init(NULL); #endif