From 3a50336886a8d48aa756033309985396b4109a96 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 20 Nov 2023 09:52:21 +0600 Subject: [PATCH] Fixed journald configuration loading --- source/ubl-settings-logging.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index a3b682c..cb41a88 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -143,7 +143,7 @@ void update_loaded_logrotate(){ } int yon_load_proceed(YON_CONFIG_TYPE type){ - if (yon_config_load_register(type,"logging",LOGROTATE("*"),JOURNALD("*"),NULL)){ + if (yon_config_load_register(type,"logging",LOGROTATE("*"),"logging",JOURNALD("*"),NULL)){ update_loaded_logrotate(); return 1; } @@ -1439,7 +1439,6 @@ void on_journald_save(GtkWidget *self, journald_window *window){ TTY = (char*)gtk_entry_get_text(GTK_ENTRY(window->RedirectTTYEntry)); if (yon_char_is_empty(TTY)) consoleforwardactive=0; - else } else if (consoleforwardactive == 2){ confor = "no"; @@ -1459,11 +1458,13 @@ void on_journald_save(GtkWidget *self, journald_window *window){ yon_config_register(JOURNALD("SplitMode"),"logging",splitmode); else yon_config_remove_by_key(JOURNALD("SplitMode")); - if (consoleforwardactive != 0) + if (consoleforwardactive != 0){ yon_config_register(JOURNALD("ForwardToConsole"),"logging",confor); yon_config_register(JOURNALD("TTYPath"),"logging",TTY); - else + } else { yon_config_remove_by_key(JOURNALD("ForwardToConsole")); + yon_config_register(JOURNALD("TTYPath"),"logging",TTY); + } if (forwardempty!=0) yon_config_register(JOURNALD("MaxLevelConsole"),"logging",yon_char_from_int(forwardempty-1)); else