From: Karel Zak Date: Tue, 4 Oct 2016 14:18:16 +0000 (+0200) Subject: lib/randutils: remove unnecessary function X-Git-Tag: v2.29-rc2~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b27fcc189fc772613ed86b315bc211d7a86bc3b;p=thirdparty%2Futil-linux.git lib/randutils: remove unnecessary function Signed-off-by: Karel Zak --- diff --git a/include/randutils.h b/include/randutils.h index 7094a4c740..86e35f3f4b 100644 --- a/include/randutils.h +++ b/include/randutils.h @@ -7,7 +7,6 @@ #endif /* rand() based */ -extern void xsrand(void); extern int rand_get_number(int low_n, int high_n); /* /dev/urandom based with fallback to rand() */ diff --git a/lib/randutils.c b/lib/randutils.c index 2e124bcb66..b93b9ba470 100644 --- a/lib/randutils.c +++ b/lib/randutils.c @@ -30,14 +30,6 @@ THREAD_LOCAL unsigned short ul_jrand_seed[3]; #endif -void xsrand(void) -{ - struct timeval tv; - - gettimeofday(&tv, 0); - srand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec); -} - int rand_get_number(int low_n, int high_n) { return rand() % (high_n - low_n + 1) + low_n; @@ -56,7 +48,9 @@ int random_get_fd(void) if (i >= 0) fcntl(fd, F_SETFD, i | FD_CLOEXEC); } - xsrand(); + + gettimeofday(&tv, 0); + srand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec); #ifdef DO_JRAND_MIX ul_jrand_seed[0] = getpid() ^ (tv.tv_sec & 0xFFFF);