summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/mconf.c
diff options
context:
space:
mode:
authorLadislav Michl <ladis@linux-mips.org>2008-01-03 21:43:30 +0000
committerLadislav Michl <ladis@linux-mips.org>2008-01-03 21:43:30 +0000
commit46a6ee0914539e1f7f923b64060533b1528e67c1 (patch)
tree51182b2085738dfc77354bdc60292c15c27df72c /scripts/kconfig/mconf.c
parente0f1130e810aaeab70d63450c84cb0474335c566 (diff)
downloadptxdist-46a6ee0914539e1f7f923b64060533b1528e67c1.tar.gz
ptxdist-46a6ee0914539e1f7f923b64060533b1528e67c1.tar.xz
Make menuconfig work under MinGW.
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@7689 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'scripts/kconfig/mconf.c')
-rw-r--r--scripts/kconfig/mconf.c46
1 files changed, 6 insertions, 40 deletions
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 8d5c6c144..f15e397f8 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -8,7 +8,6 @@
* i18n, 2005, Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*/
-#include <sys/ioctl.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
@@ -265,7 +264,6 @@ search_help[] = N_(
"\n");
static int indent;
-static int rows = 0, cols = 0;
static struct menu *current_menu;
static int child_count;
static int single_menu_mode;
@@ -279,41 +277,6 @@ static void show_textbox(const char *title, const char *text, int r, int c);
static void show_helptext(const char *title, const char *text);
static void show_help(struct menu *menu);
-static void init_wsize(void)
-{
- struct winsize ws;
- char *env;
-
- if (!ioctl(STDIN_FILENO, TIOCGWINSZ, &ws)) {
- rows = ws.ws_row;
- cols = ws.ws_col;
- }
-
- if (!rows) {
- env = getenv("LINES");
- if (env)
- rows = atoi(env);
- if (!rows)
- rows = 24;
- }
- if (!cols) {
- env = getenv("COLUMNS");
- if (env)
- cols = atoi(env);
- if (!cols)
- cols = 80;
- }
-
- if (rows < 19 || cols < 80) {
- fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
- fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
- exit(1);
- }
-
- rows -= 4;
- cols -= 5;
-}
-
static void get_prompt_str(struct gstr *r, struct property *prop)
{
int i, j;
@@ -897,9 +860,12 @@ int main(int ac, char **av)
}
atexit(conf_cleanup);
- init_wsize();
- reset_dialog();
- init_dialog(NULL);
+ if (init_dialog(NULL)) {
+ fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
+ fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
+ return 1;
+ }
+
set_config_filename(conf_get_configname());
do {
conf(&rootmenu);