mirror of
https://github.com/sheumann/hush.git
synced 2025-01-18 07:31:34 +00:00
lineedit: add missing #if/#endif
init: fix warnings
This commit is contained in:
parent
4921b54f37
commit
e968fcd562
@ -727,20 +727,19 @@ static void exec_signal(int sig ATTRIBUTE_UNUSED)
|
|||||||
|
|
||||||
static void shutdown_signal(int sig)
|
static void shutdown_signal(int sig)
|
||||||
{
|
{
|
||||||
char *m;
|
const char *m;
|
||||||
int rb;
|
int rb;
|
||||||
|
|
||||||
shutdown_system();
|
shutdown_system();
|
||||||
|
|
||||||
|
m = "halt";
|
||||||
|
rb = RB_HALT_SYSTEM;
|
||||||
if (sig == SIGTERM) {
|
if (sig == SIGTERM) {
|
||||||
m = "reboot";
|
m = "reboot";
|
||||||
rb = RB_AUTOBOOT;
|
rb = RB_AUTOBOOT;
|
||||||
} else if (sig == SIGUSR2) {
|
} else if (sig == SIGUSR2) {
|
||||||
m = "poweroff";
|
m = "poweroff";
|
||||||
rb = RB_POWER_OFF;
|
rb = RB_POWER_OFF;
|
||||||
} else {
|
|
||||||
m = "halt";
|
|
||||||
rb = RB_HALT_SYSTEM;
|
|
||||||
}
|
}
|
||||||
message(CONSOLE | LOG, "Requesting system %s.", m);
|
message(CONSOLE | LOG, "Requesting system %s.", m);
|
||||||
sync();
|
sync();
|
||||||
|
@ -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 */
|
/* With null flags, no other fields are ever used */
|
||||||
state = st ? st : (line_input_t*) &const_int_0;
|
state = st ? st : (line_input_t*) &const_int_0;
|
||||||
|
#if ENABLE_FEATURE_EDITING_SAVEHISTORY
|
||||||
if (state->flags & SAVE_HISTORY)
|
if (state->flags & SAVE_HISTORY)
|
||||||
load_history(state->hist_file);
|
load_history(state->hist_file);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* prepare before init handlers */
|
/* prepare before init handlers */
|
||||||
cmdedit_y = 0; /* quasireal y, not true if line > xt*yt */
|
cmdedit_y = 0; /* quasireal y, not true if line > xt*yt */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user