diff options
author | Ailin Nemui <ailin@linux.site> | 2015-02-17 09:44:33 +0100 |
---|---|---|
committer | Ailin Nemui <ailin@linux.site> | 2015-02-17 09:50:55 +0100 |
commit | 1e4f7e63249b0300cac27e725e14a0134260a387 (patch) | |
tree | 3c9914120333df650e2c85b8a9ca976c1289d022 /src/fe-text/irssi.c | |
parent | af6b789d2a6cadce0b8050f9233cacb1d0595913 (diff) | |
download | irssi-1e4f7e63249b0300cac27e725e14a0134260a387.zip |
Refuse to load broken configs on irssi start
By temporarily raising the fatal log level to critical during irssi
start-up, we make it fail when the config file is broken. This is then
re-set so that /reload of a broken config file will not crash irssi and
just report the errors and gracefully continue instead.
Diffstat (limited to 'src/fe-text/irssi.c')
-rw-r--r-- | src/fe-text/irssi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c index 77033d7a..6d5b9b13 100644 --- a/src/fe-text/irssi.c +++ b/src/fe-text/irssi.c @@ -310,6 +310,7 @@ int main(int argc, char **argv) { "version", 'v', 0, G_OPTION_ARG_NONE, &version, "Display irssi version", NULL }, { NULL } }; + int loglev; #ifdef USE_GC g_mem_set_vtable(&gc_mem_table); @@ -352,6 +353,7 @@ int main(int argc, char **argv) you have to call setlocale(LC_ALL, "") */ setlocale(LC_ALL, ""); + loglev = g_log_set_always_fatal(G_LOG_FATAL_MASK | G_LOG_LEVEL_CRITICAL); textui_init(); if (!dummy && !term_init()) { @@ -360,6 +362,7 @@ int main(int argc, char **argv) return 1; } + g_log_set_always_fatal(loglev); textui_finish_init(); main_loop = g_main_new(TRUE); |