From c6988f720c49e12fbe06a155fa0f8b1589d2ffdc Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Thu, 12 Mar 2009 15:15:31 +0100 Subject: [PATCH] --- yaml --- r: 132513 b: refs/heads/master c: b0fe551000179c868d46266278a890eab878baca h: refs/heads/master i: 132511: d9bb68e4acdea9e9c3ae53e3d75f52b48838ea4f v: v3 --- [refs] | 2 +- trunk/scripts/kconfig/conf.c | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 71612145b01f..9398c50dce4c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 184832c981fd38b1052f2dfa0262e793fa6c67d3 +refs/heads/master: b0fe551000179c868d46266278a890eab878baca diff --git a/trunk/scripts/kconfig/conf.c b/trunk/scripts/kconfig/conf.c index 3e1057f885c6..d190092c3b6e 100644 --- a/trunk/scripts/kconfig/conf.c +++ b/trunk/scripts/kconfig/conf.c @@ -11,6 +11,7 @@ #include #include #include +#include #define LKC_DIRECT_LINK #include "lkc.h" @@ -464,9 +465,22 @@ int main(int ac, char **av) input_mode = set_yes; break; case 'r': + { + struct timeval now; + unsigned int seed; + + /* + * Use microseconds derived seed, + * compensate for systems where it may be zero + */ + gettimeofday(&now, NULL); + + seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1)); + srand(seed); + input_mode = set_random; - srand(time(NULL)); break; + } case 'h': printf(_("See README for usage info\n")); exit(0);