From: Denis Vlasenko Date: Sat, 3 Feb 2007 02:42:47 +0000 (-0000) Subject: lineedit: add missing #if/#endif X-Git-Tag: 1_5_1~217 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e968fcd562da08591b0f7990b839174ad93fc7b4;p=oweals%2Fbusybox.git lineedit: add missing #if/#endif init: fix warnings --- diff --git a/init/init.c b/init/init.c index 110af8566..b652bc1f4 100644 --- a/init/init.c +++ b/init/init.c @@ -727,20 +727,19 @@ static void exec_signal(int sig ATTRIBUTE_UNUSED) static void shutdown_signal(int sig) { - char *m; + const char *m; int rb; shutdown_system(); + m = "halt"; + rb = RB_HALT_SYSTEM; if (sig == SIGTERM) { m = "reboot"; rb = RB_AUTOBOOT; } else if (sig == SIGUSR2) { m = "poweroff"; rb = RB_POWER_OFF; - } else { - m = "halt"; - rb = RB_HALT_SYSTEM; } message(CONSOLE | LOG, "Requesting system %s.", m); sync(); @@ -775,7 +774,7 @@ static void cont_handler(int sig ATTRIBUTE_UNUSED) got_cont = 1; } -#endif /* ! ENABLE_DEBUG_INIT */ +#endif /* !ENABLE_DEBUG_INIT */ static void new_init_action(int action, const char *command, const char *cons) { diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 343890868..937d70d1f 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -1269,8 +1269,10 @@ int read_line_input(const char* prompt, char* command, int maxsize, line_input_t /* With null flags, no other fields are ever used */ state = st ? st : (line_input_t*) &const_int_0; +#if ENABLE_FEATURE_EDITING_SAVEHISTORY if (state->flags & SAVE_HISTORY) load_history(state->hist_file); +#endif /* prepare before init handlers */ cmdedit_y = 0; /* quasireal y, not true if line > xt*yt */