summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2010-07-22 14:16:42 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2010-07-22 14:17:51 +0200
commit7705e6e4150a5271f574c52c5a76b75116dc0875 (patch)
treeac93f2f483319f0fc2d18d9b5d57a7309afeef7e
parent6ef765d3bd17e5dc9ea2c049cb79443b23fdcd16 (diff)
downloadbuildroot-novena-7705e6e4150a5271f574c52c5a76b75116dc0875.tar.gz
buildroot-novena-7705e6e4150a5271f574c52c5a76b75116dc0875.zip
kconfig: make rand{,package}config fair
Give each boolean symbol a 50% chance of getting enabled, rather than 67%. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
-rw-r--r--package/config/confdata.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/package/config/confdata.c b/package/config/confdata.c
index 51a3d9a6f..728f708ca 100644
--- a/package/config/confdata.c
+++ b/package/config/confdata.c
@@ -864,7 +864,8 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
sym->def[S_DEF_USER].tri = no;
break;
case def_random:
- sym->def[S_DEF_USER].tri = (tristate)(rand() % 3);
+ cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2;
+ sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt);
break;
default:
continue;