aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/config/mconf.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-08-03 19:47:34 +0200
committerFelix Fietkau <nbd@nbd.name>2016-08-03 20:03:35 +0200
commit2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5 (patch)
tree43bc0a7953f008fad5fbc793e8d2dfca2e540081 /scripts/config/mconf.c
parent7bf3695b0230d4cc4b6348f7c87b3c164314db8d (diff)
downloadupstream-2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5.tar.gz
upstream-2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5.tar.bz2
upstream-2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5.zip
scripts/config: sync with latest linux upstream
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'scripts/config/mconf.c')
-rw-r--r--scripts/config/mconf.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/scripts/config/mconf.c b/scripts/config/mconf.c
index f437dd7176..c366e21fba 100644
--- a/scripts/config/mconf.c
+++ b/scripts/config/mconf.c
@@ -275,6 +275,7 @@ static int child_count;
static int single_menu_mode;
static int show_all_options;
static int save_and_exit;
+static int silent;
static void conf(struct menu *menu, struct menu *active_menu);
static void conf_choice(struct menu *menu);
@@ -773,10 +774,12 @@ static void conf_message_callback(const char *fmt, va_list ap)
char buf[PATH_MAX+1];
vsnprintf(buf, sizeof(buf), fmt, ap);
- if (save_and_exit)
- printf("%s", buf);
- else
+ if (save_and_exit) {
+ if (!silent)
+ printf("%s", buf);
+ } else {
show_textbox(NULL, buf, 6, 60);
+ }
}
static void show_help(struct menu *menu)
@@ -983,16 +986,18 @@ static int handle_exit(void)
}
/* fall through */
case -1:
- printf(_("\n\n"
- "*** End of the configuration.\n"
- "*** Execute 'make' to start the build or try 'make help'."
- "\n\n"));
+ if (!silent)
+ printf(_("\n\n"
+ "*** End of the configuration.\n"
+ "*** Execute 'make' to start the build or try 'make help'."
+ "\n\n"));
res = 0;
break;
default:
- fprintf(stderr, _("\n\n"
- "Your configuration changes were NOT saved."
- "\n\n"));
+ if (!silent)
+ fprintf(stderr, _("\n\n"
+ "Your configuration changes were NOT saved."
+ "\n\n"));
if (res != KEY_ESC)
res = 0;
}
@@ -1016,6 +1021,12 @@ int main(int ac, char **av)
signal(SIGINT, sig_handler);
+ if (ac > 1 && strcmp(av[1], "-s") == 0) {
+ silent = 1;
+ /* Silence conf_read() until the real callback is set up */
+ conf_set_message_callback(NULL);
+ av++;
+ }
conf_parse(av[1]);
conf_read(NULL);