diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2009-08-17 19:17:00 +0200 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2009-08-17 19:17:00 +0200 |
commit | 49d8a0e9c6e32701c7eca91a1204237d3a334e38 (patch) | |
tree | 500e0c09a66970494dffbfe3a36f958762d22f99 /extra/config/conf.c | |
parent | 7f779e7937cca133ea5f2d18c154c6564516fd9f (diff) |
support building out-of-tree
Handle O=
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'extra/config/conf.c')
-rw-r--r-- | extra/config/conf.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/extra/config/conf.c b/extra/config/conf.c index 02b2600c2..d623ed1d3 100644 --- a/extra/config/conf.c +++ b/extra/config/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" @@ -432,6 +433,7 @@ int main(int ac, char **av) { int opt; const char *name; + const char *configname = conf_get_configname(); struct stat tmpstat; setlocale(LC_ALL, ""); @@ -464,9 +466,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); @@ -484,7 +499,7 @@ int main(int ac, char **av) conf_parse(name); //zconfdump(stdout); if (sync_kconfig) { - if (stat(".config", &tmpstat)) { + if (stat(configname, &tmpstat)) { fprintf(stderr, _("***\n" "*** You have not yet configured!\n" "*** (missing .config file)\n" |