Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132513
b: refs/heads/master
c: b0fe551
h: refs/heads/master
i:
  132511: d9bb68e
v: v3
  • Loading branch information
Ingo Molnar authored and Sam Ravnborg committed Mar 15, 2009
1 parent 5dc3851 commit c6988f7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 184832c981fd38b1052f2dfa0262e793fa6c67d3
refs/heads/master: b0fe551000179c868d46266278a890eab878baca
16 changes: 15 additions & 1 deletion trunk/scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c6988f7

Please sign in to comment.