diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-23 16:53:20 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-23 16:53:20 +0100 |
commit | efd247fa34084d9b162f485004ae6d8a04059f0c (patch) | |
tree | 417dcbe06d5cce1353a4c19cbda480ae67652b5c /scripts/kconfig/conf.c | |
parent | af66df5ecf9c9e2d2ff86e8203510c1c4519d64c (diff) | |
parent | 59fcbddaff6f862cc1584b488866d9c4a5579085 (diff) |
Merge branches 'sched/debug' and 'linus' into sched/core
Diffstat (limited to 'scripts/kconfig/conf.c')
-rw-r--r-- | scripts/kconfig/conf.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 3e1057f885c..d190092c3b6 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -11,6 +11,7 @@ #include <time.h> #include <unistd.h> #include <sys/stat.h> +#include <sys/time.h> #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); |