aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/conf.c')
-rw-r--r--scripts/kconfig/conf.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 3e1057f885c6..d190092c3b6e 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -11,6 +11,7 @@
11#include <time.h> 11#include <time.h>
12#include <unistd.h> 12#include <unistd.h>
13#include <sys/stat.h> 13#include <sys/stat.h>
14#include <sys/time.h>
14 15
15#define LKC_DIRECT_LINK 16#define LKC_DIRECT_LINK
16#include "lkc.h" 17#include "lkc.h"
@@ -464,9 +465,22 @@ int main(int ac, char **av)
464 input_mode = set_yes; 465 input_mode = set_yes;
465 break; 466 break;
466 case 'r': 467 case 'r':
468 {
469 struct timeval now;
470 unsigned int seed;
471
472 /*
473 * Use microseconds derived seed,
474 * compensate for systems where it may be zero
475 */
476 gettimeofday(&now, NULL);
477
478 seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1));
479 srand(seed);
480
467 input_mode = set_random; 481 input_mode = set_random;
468 srand(time(NULL));
469 break; 482 break;
483 }
470 case 'h': 484 case 'h':
471 printf(_("See README for usage info\n")); 485 printf(_("See README for usage info\n"));
472 exit(0); 486 exit(0);