diff --git a/source/ubl-settings-resourcequota.c b/source/ubl-settings-resourcequota.c index e4c31e1..7776967 100644 --- a/source/ubl-settings-resourcequota.c +++ b/source/ubl-settings-resourcequota.c @@ -209,11 +209,14 @@ main_window *setup_window(){ void main_update_dispatcher() { int second = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widgets->spinUpdateDispatcher)); - char* str_second = yon_char_from_int(second); - char *cmd = yon_char_get_augumented("systemd-cgtop -d ", str_second); - yon_terminal_integrated_launch(widgets->vteDispatcher, cmd, NULL, NULL); - free(str_second); - free(cmd); + if (second>0) { + char* str_second = yon_char_from_int(second); + char *cmd = yon_char_get_augumented("systemd-cgtop -d ", str_second); + yon_terminal_integrated_launch(widgets->vteDispatcher, cmd, NULL, NULL); + free(str_second); + free(cmd); + } + } void main_update_processes() { @@ -438,14 +441,12 @@ void str_split_value(char* values, int index) { } init_cfg_array(index); char* value_i = NULL; - for (int index_1 = 0; index_1 < size; index_1++) { + int index_1 = 0; + for (index_1=0; index_1 < size; index_1++) { value = yon_char_new(arr_values[index_1]); key = yon_char_divide_search(value, "=", -1); - if (yon_char_find_count(key, "IOReadBandwidthMax") != 0) { - get_param_io_limit(arr_values, index_1, size,index, "IOReadBandwidthMax"); - } - if (yon_char_find_count(key, "IOWriteBandwidthMax") != 0) { - get_param_io_limit(arr_values, index_1, size,index, "IOWriteBandwidthMax"); + if (strstr(key, "IOReadBandwidthMax") || strstr(key, "IOWriteBandwidthMax")) { + break; } if (yon_char_find_count(key, "MemoryHigh") != 0) { philos_set_pow_size_memory(yon_char_new(value), &main_config.soft_raw_limit_size, index, array_size_pow); @@ -464,6 +465,8 @@ void str_split_value(char* values, int index) { set_size_memory_integer(yon_char_new(value), &main_config.cpu_limit, index); } } + get_param_io_limit(arr_values, index_1, size,index, "IOReadBandwidthMax"); + get_param_io_limit(arr_values, index_1, size,index, "IOWriteBandwidthMax"); } diff --git a/source/view_add.c b/source/view_add.c index 228dbdf..f9e7628 100644 --- a/source/view_add.c +++ b/source/view_add.c @@ -75,8 +75,6 @@ void event_check_io_device() { add_init_windows(); philos_temp_add_disk(add_widgets, &obj_add_config, 0); philos_temp_add_disk(add_widgets, &obj_add_config, 1); - //philos_temp_del_disk(add_widgets, &obj_add_config, 0); - //philos_temp_del_disk(add_widgets, &obj_add_config, 1); philos_temp_generate_cmd(add_widgets, &obj_add_config); } diff --git a/ubl-settings-resourcequota.glade b/ubl-settings-resourcequota.glade index 8a29fb4..658900c 100644 --- a/ubl-settings-resourcequota.glade +++ b/ubl-settings-resourcequota.glade @@ -2377,6 +2377,7 @@ + 1 10000 1 1