From a602abf244fb94272b2fa0977e6d4ad50df23500 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 31 Mar 2016 11:22:06 -0400 Subject: [PATCH] Switch to gettimeofday() for seeding on UNIX --- unix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unix.c b/unix.c index b0b026d..a6b44f8 100644 --- a/unix.c +++ b/unix.c @@ -79,7 +79,11 @@ enet_deinitialize (void) enet_uint32 enet_host_random_seed (void) { - return (enet_uint32) time (NULL); + struct timeval timeVal; + + gettimeofday (& timeVal, NULL); + + return (timeVal.tv_sec * 1000) ^ (timeVal.tv_usec / 1000); } enet_uint32