From 69710ec8ab8753203f4343d2f0bc1ac8f94b49a2 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 13 Jul 2024 23:52:46 -0500 Subject: [PATCH] Progress: Continue migrating the project. --- sources/c/main/common/type/lock.c | 2 + sources/c/main/convert.c | 12 +++-- sources/c/main/entry/action.c | 3 +- sources/c/main/entry/setting.c | 15 +++--- sources/c/main/print/output/entry/setting.c | 1 - sources/c/main/print/output/rule/validate.c | 11 ++++- sources/c/main/process.c | 2 - sources/c/main/rule.c | 73 +++++++++++++++-------------- sources/c/main/rule/action.c | 46 +++++++++++++----- sources/c/main/rule/execute.c | 16 ++----- sources/c/main/rule/expand.c | 56 +++++++++++++--------- sources/c/main/rule/instance.c | 7 +-- sources/c/main/rule/parameter.c | 9 ++-- sources/c/main/rule/setting.c | 4 +- sources/c/main/status.c | 5 +- sources/c/main/thread/entry.c | 9 ++-- 16 files changed, 153 insertions(+), 118 deletions(-) diff --git a/sources/c/main/common/type/lock.c b/sources/c/main/common/type/lock.c index e7e4454..03c5366 100644 --- a/sources/c/main/common/type/lock.c +++ b/sources/c/main/common/type/lock.c @@ -17,6 +17,8 @@ extern "C" { f_thread_lock_delete(&lock->rule); f_thread_condition_delete(&lock->alert_condition); + + lock->flag |= controller_lock_flag_setup_not_d; } #endif // _di_controller_lock_delete_ diff --git a/sources/c/main/convert.c b/sources/c/main/convert.c index 59c59cb..d6dd6af 100644 --- a/sources/c/main/convert.c +++ b/sources/c/main/convert.c @@ -16,9 +16,11 @@ extern "C" { cache->action.generic.used = 0; status = f_rip_dynamic_partial_nulless(buffer, range, &cache->action.generic); - if (F_status_is_error(status)) return status; - status = f_account_id_by_name(cache->action.generic, id); + if (F_status_is_error_not(status)) { + status = f_account_id_by_name(cache->action.generic, id); + } + if (F_status_is_error(status)) return status; return (status == F_exist_not) ? F_status_set_error(F_exist_not) : F_okay; @@ -43,9 +45,11 @@ extern "C" { cache->action.generic.used = 0; status = f_rip_dynamic_partial_nulless(buffer, range, &cache->action.generic); - if (F_status_is_error(status)) return status; - status = f_account_group_id_by_name(cache->action.generic, id); + if (F_status_is_error_not(status)) { + status = f_account_group_id_by_name(cache->action.generic, id); + } + if (F_status_is_error(status)) return status; return (status == F_exist_not) ? F_status_set_error(F_exist_not) : F_okay; diff --git a/sources/c/main/entry/action.c b/sources/c/main/entry/action.c index 7aaf080..eb48539 100644 --- a/sources/c/main/entry/action.c +++ b/sources/c/main/entry/action.c @@ -9,8 +9,6 @@ extern "C" { if (!main || !entry || !actions) return F_status_set_error(F_parameter); - f_status_t status_action = F_okay; - actions->used = 0; main->thread.cache.object_actions.used = main->thread.cache.object_actions.size; @@ -59,6 +57,7 @@ extern "C" { return state.status; } + f_status_t status_action = F_okay; controller_entry_action_t *action = 0; f_number_unsigned_t allocate = 0; diff --git a/sources/c/main/entry/setting.c b/sources/c/main/entry/setting.c index 2cfd9e0..ed0de40 100644 --- a/sources/c/main/entry/setting.c +++ b/sources/c/main/entry/setting.c @@ -419,15 +419,18 @@ extern "C" { { f_status_t status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_map_t), (void **) &setting_maps->array, &setting_maps->used, &setting_maps->size); - if (F_status_is_error(status)) return status; - setting_maps->array[setting_maps->used].key.used = 0; - setting_maps->array[setting_maps->used].value.used = 0; + if (F_status_is_error_not(status)) { + setting_maps->array[setting_maps->used].key.used = 0; + setting_maps->array[setting_maps->used].value.used = 0; - status = f_string_dynamic_partial_append_nulless(buffer, ranges.array[0], &setting_maps->array[setting_maps->used].key); - if (F_status_is_error(status)) return status; + status = f_string_dynamic_partial_append_nulless(buffer, ranges.array[0], &setting_maps->array[setting_maps->used].key); + } + + if (F_status_is_error_not(status)) { + status = f_string_dynamic_partial_append_nulless(buffer, ranges.array[1], &setting_maps->array[setting_maps->used].value); + } - status = f_string_dynamic_partial_append_nulless(buffer, ranges.array[1], &setting_maps->array[setting_maps->used].value); if (F_status_is_error(status)) return status; } diff --git a/sources/c/main/print/output/entry/setting.c b/sources/c/main/print/output/entry/setting.c index 6a47d83..ebe966a 100644 --- a/sources/c/main/print/output/entry/setting.c +++ b/sources/c/main/print/output/entry/setting.c @@ -45,7 +45,6 @@ extern "C" { if (print->verbosity < f_console_verbosity_error_e) return F_output_not; controller_t * const main = (controller_t *) print->custom; - controller_entry_t * const entry = is_entry ? &main->process.entry : &main->process.exit; controller_lock_print(print->to, &main->thread); diff --git a/sources/c/main/print/output/rule/validate.c b/sources/c/main/print/output/rule/validate.c index 2ce32c7..04e26ce 100644 --- a/sources/c/main/print/output/rule/validate.c +++ b/sources/c/main/print/output/rule/validate.c @@ -405,6 +405,7 @@ extern "C" { } else { rerun_item = 0; + continue; } @@ -412,41 +413,47 @@ extern "C" { switch (j) { case controller_rule_action_execute_type_freeze_e: f_print_dynamic_raw(controller_freeze_s, print->to); + break; case controller_rule_action_execute_type_kill_e: f_print_dynamic_raw(controller_kill_s, print->to); + break; case controller_rule_action_execute_type_pause_e: f_print_dynamic_raw(controller_pause_s, print->to); + break; case controller_rule_action_execute_type_reload_e: f_print_dynamic_raw(controller_reload_s, print->to); + break; case controller_rule_action_execute_type_restart_e: f_print_dynamic_raw(controller_restart_s, print->to); + break; case controller_rule_action_execute_type_resume_e: f_print_dynamic_raw(controller_resume_s, print->to); + break; case controller_rule_action_execute_type_start_e: f_print_dynamic_raw(controller_start_s, print->to); + break; case controller_rule_action_execute_type_stop_e: f_print_dynamic_raw(controller_stop_s, print->to); + break; case controller_rule_action_execute_type_thaw_e: f_print_dynamic_raw(controller_thaw_s, print->to); - break; - default: break; } diff --git a/sources/c/main/process.c b/sources/c/main/process.c index 17f9267..29d513a 100644 --- a/sources/c/main/process.c +++ b/sources/c/main/process.c @@ -139,8 +139,6 @@ extern "C" { main->thread.id_rule = 0; main->thread.id_signal = 0; - controller_thread_delete(&main->thread); - if (F_status_set_fine(status) == F_interrupt) { main->setting.state.status = F_status_set_error(F_interrupt); diff --git a/sources/c/main/rule.c b/sources/c/main/rule.c index 0ff8d1e..1f02bb5 100644 --- a/sources/c/main/rule.c +++ b/sources/c/main/rule.c @@ -67,27 +67,35 @@ extern "C" { f_status_t status = F_okay; status = f_string_dynamic_append(source.alias, &destination->alias); - if (F_status_is_error(status)) return status; - status = f_string_dynamic_append(source.engine, &destination->engine); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(source.engine, &destination->engine); + } - status = f_string_dynamic_append(source.name, &destination->name); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(source.name, &destination->name); + } - status = f_string_dynamic_append(source.path, &destination->path); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(source.path, &destination->path); + } - status = f_string_maps_append_all(source.define, &destination->define); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_string_maps_append_all(source.define, &destination->define); + } - status = f_string_maps_append_all(source.parameter, &destination->parameter); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_string_maps_append_all(source.parameter, &destination->parameter); + } - status = f_string_dynamics_append_all(source.engine_arguments, &destination->engine_arguments); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamics_append_all(source.engine_arguments, &destination->engine_arguments); + } + + if (F_status_is_error_not(status)) { + status = f_string_dynamics_append_all(source.environment, &destination->environment); + } - status = f_string_dynamics_append_all(source.environment, &destination->environment); if (F_status_is_error(status)) return status; if (source.ons.used) { @@ -126,21 +134,24 @@ extern "C" { } status = f_memory_array_append_all((void *) source.affinity.array, source.affinity.used, sizeof(int32_t), (void **) &destination->affinity.array, &destination->affinity.used, &destination->affinity.size); - if (F_status_is_error(status)) return status; - if (source.capability) { + if (F_status_is_error_not(status) && source.capability) { status = f_capability_copy(source.capability, &destination->capability); - if (F_status_is_error(status)) return status; } - status = f_control_group_copy(source.cgroup, &destination->cgroup); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_control_group_copy(source.cgroup, &destination->cgroup); + } - status = f_memory_array_append_all(source.groups.array, source.groups.used, sizeof(int32_t), (void **) &destination->groups.array, &destination->groups.used, &destination->groups.size); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_memory_array_append_all(source.groups.array, source.groups.used, sizeof(int32_t), (void **) &destination->groups.array, &destination->groups.used, &destination->groups.size); + } + + if (F_status_is_error_not(status)) { + destination->limits.used = 0; + status = f_memory_array_append_all(source.limits.array, source.limits.used, sizeof(f_limit_set_t), (void **) &destination->limits.array, &destination->limits.used, &destination->limits.size); + } - destination->limits.used = 0; - status = f_memory_array_append_all(source.limits.array, source.limits.used, sizeof(f_limit_set_t), (void **) &destination->limits.array, &destination->limits.used, &destination->limits.size); if (F_status_is_error(status)) return status; if (source.items.used) { @@ -244,22 +255,14 @@ extern "C" { f_status_t status = f_string_dynamic_partial_append_nulless(source, directory, alias); - if (F_status_is_error(status)) { - controller_print_error_status(&main->program.error, macro_controller_f(f_string_dynamic_partial_append_nulless), F_status_set_fine(status)); - - return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append_nulless(f_path_separator_s, alias); } - status = f_string_dynamic_append(f_path_separator_s, alias); - - if (F_status_is_error(status)) { - controller_print_error_status(&main->program.error, macro_controller_f(f_string_dynamic_append), F_status_set_fine(status)); - - return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_partial_append_nulless(source, basename, alias); } - status = f_string_dynamic_partial_append_nulless(source, basename, alias); - if (F_status_is_error(status)) { controller_print_error_status(&main->program.error, macro_controller_f(f_string_dynamic_partial_append_nulless), F_status_set_fine(status)); } diff --git a/sources/c/main/rule/action.c b/sources/c/main/rule/action.c index 06ed82b..d0e8163 100644 --- a/sources/c/main/rule/action.c +++ b/sources/c/main/rule/action.c @@ -7,8 +7,13 @@ extern "C" { #ifndef _di_controller_rule_action_method_name_ f_string_static_t controller_rule_action_method_name(const uint8_t type) { - if (type == controller_rule_action_method_extended_e) return controller_rule_action_method_extended_s; - if (type == controller_rule_action_method_extended_list_e) return controller_rule_action_method_extended_list_s; + switch (type) { + case controller_rule_action_method_extended_e: + return controller_rule_action_method_extended_s; + + case controller_rule_action_method_extended_list_e: + return controller_rule_action_method_extended_list_s; + } return f_string_empty_s; } @@ -17,15 +22,34 @@ extern "C" { #ifndef _di_controller_rule_action_type_to_action_execute_type_ uint8_t controller_rule_action_type_to_action_execute_type(const uint8_t type) { - if (type == controller_rule_action_type_freeze_e) return controller_rule_action_execute_type_freeze_e; - if (type == controller_rule_action_type_kill_e) return controller_rule_action_execute_type_kill_e; - if (type == controller_rule_action_type_pause_e) return controller_rule_action_execute_type_pause_e; - if (type == controller_rule_action_type_reload_e) return controller_rule_action_execute_type_reload_e; - if (type == controller_rule_action_type_restart_e) return controller_rule_action_execute_type_restart_e; - if (type == controller_rule_action_type_resume_e) return controller_rule_action_execute_type_resume_e; - if (type == controller_rule_action_type_start_e) return controller_rule_action_execute_type_start_e; - if (type == controller_rule_action_type_stop_e) return controller_rule_action_execute_type_stop_e; - if (type == controller_rule_action_type_thaw_e) return controller_rule_action_execute_type_thaw_e; + switch (type) { + case controller_rule_action_type_freeze_e: + return controller_rule_action_execute_type_freeze_e; + + case controller_rule_action_type_kill_e: + return controller_rule_action_execute_type_kill_e; + + case controller_rule_action_type_pause_e: + return controller_rule_action_execute_type_pause_e; + + case controller_rule_action_type_reload_e: + return controller_rule_action_execute_type_reload_e; + + case controller_rule_action_type_restart_e: + return controller_rule_action_execute_type_restart_e; + + case controller_rule_action_type_resume_e: + return controller_rule_action_execute_type_resume_e; + + case controller_rule_action_type_start_e: + return controller_rule_action_execute_type_start_e; + + case controller_rule_action_type_stop_e: + return controller_rule_action_execute_type_stop_e; + + case controller_rule_action_type_thaw_e: + return controller_rule_action_execute_type_thaw_e; + } return controller_rule_action_execute_type__enum_size_e; } diff --git a/sources/c/main/rule/execute.c b/sources/c/main/rule/execute.c index c179053..f3a5190 100644 --- a/sources/c/main/rule/execute.c +++ b/sources/c/main/rule/execute.c @@ -600,21 +600,15 @@ extern "C" { if (!execute_set || !instance || !instance->main) return F_status_set_error(F_parameter); f_status_t status = F_okay; - controller_t * const main = instance->main; - f_execute_result_t result = f_execute_result_t_initialize; status = f_memory_array_increase(controller_allocation_small_d, sizeof(pid_t), (void **) &instance->childs.array, &instance->childs.used, &instance->childs.size); - if (F_status_is_error(status)) { - controller_print_error_status(&main->program.error, macro_controller_f(f_memory_array_increase), F_status_set_fine(status)); - - return status; + if (F_status_is_error_not(status)) { + status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &instance->path_pids.array, &instance->path_pids.used, &instance->path_pids.size); } - status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &instance->path_pids.array, &instance->path_pids.used, &instance->path_pids.size); - if (F_status_is_error(status)) { controller_print_error_status(&main->program.error, macro_controller_f(f_memory_array_increase), F_status_set_fine(status)); @@ -789,17 +783,15 @@ extern "C" { f_time_spec_t delay = f_time_spec_t_initialize; { - const f_status_t status = f_time_spec_millisecond(0, rerun_item->delay, &delay); + f_status_t status = f_time_spec_millisecond(0, rerun_item->delay, &delay); if (F_status_is_error(status)) { controller_print_error_status(&main->program.error, macro_controller_f(f_time_spec_millisecond), F_status_set_fine(status)); return -1; } - } - { - const f_status_t status = controller_time_sleep_nanoseconds(instance->main, delay); + status = controller_time_sleep_nanoseconds(instance->main, delay); if (F_status_is_error(status) || status == F_interrupt) return -1; } diff --git a/sources/c/main/rule/expand.c b/sources/c/main/rule/expand.c index e29779f..bbf7189 100644 --- a/sources/c/main/rule/expand.c +++ b/sources/c/main/rule/expand.c @@ -91,8 +91,7 @@ extern "C" { f_status_t controller_rule_expand_iki(controller_instance_t * const instance, const f_string_static_t source, const f_range_t vocabulary, const f_range_t content, f_string_dynamic_t * const destination) { if (!instance || !instance->main || !destination) return F_status_set_error(F_parameter); - if (vocabulary.start > vocabulary.stop) return F_okay; - if (content.start > content.stop) return F_okay; + if (vocabulary.start > vocabulary.stop || content.start > content.stop) return F_okay; f_status_t status = F_okay; @@ -140,9 +139,11 @@ extern "C" { instance->cache.action.generic.used = 0; status = f_environment_get(buffer, &instance->cache.action.generic); - if (F_status_is_error(status)) return status; - status = f_string_dynamic_append(instance->cache.action.generic, destination); + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(instance->cache.action.generic, destination); + } + if (F_status_is_error(status)) return status; } } @@ -291,30 +292,40 @@ extern "C" { const f_number_unsigned_t index = parameters->array[codes[i]].values.array[parameters->array[codes[i]].values.used - 1]; status = f_memory_array_increase_by(symbols[i].used + expands[i].used + f_string_ascii_space_s.used + argv[index].used + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); - if (F_status_is_error(status)) return status; - status = f_string_dynamic_append(symbols[i], destination); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(symbols[i], destination); + } - status = f_string_dynamic_append(expands[i], destination); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(expands[i], destination); + } - status = f_string_dynamic_append(f_string_ascii_space_s, destination); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(f_string_ascii_space_s, destination); + } + + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(argv[index], destination); + } - status = f_string_dynamic_append(argv[index], destination); if (F_status_is_error(status)) return status; } } else { if (parameters->array[codes[i]].result & f_console_result_found_e) { - status = f_memory_array_increase_by(symbols[i].used + expands[i].used + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_memory_array_increase_by(symbols[i].used + expands[i].used + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); + } - status = f_string_dynamic_append(symbols[i], destination); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(symbols[i], destination); + } + + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(expands[i], destination); + } - status = f_string_dynamic_append(expands[i], destination); if (F_status_is_error(status)) return status; } } @@ -335,12 +346,15 @@ extern "C" { if (f_compare_dynamic_partial_string(buffer.string, source, buffer.used, content) == F_equal_to) { if (values[i] && parameters->array[codes[i]].result & f_console_result_value_e || !values[i] && (parameters->array[codes[i]].result & f_console_result_found_e)) { status = f_memory_array_increase_by(symbols[i].used + expands[i].used + 1, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); - if (F_status_is_error(status)) return status; - status = f_string_dynamic_append(symbols[i], destination); - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(symbols[i], destination); + } + + if (F_status_is_error_not(status)) { + status = f_string_dynamic_append(expands[i], destination); + } - status = f_string_dynamic_append(expands[i], destination); if (F_status_is_error(status)) return status; } diff --git a/sources/c/main/rule/instance.c b/sources/c/main/rule/instance.c index 4a46650..c933d6c 100644 --- a/sources/c/main/rule/instance.c +++ b/sources/c/main/rule/instance.c @@ -366,7 +366,6 @@ extern "C" { // Find at least one of the requested Action when the Rule is required. if (instance->options & controller_instance_option_require_e) { bool missing = F_true; - f_number_unsigned_t j = 0; for (i = 0; i < instance->rule.items.used; ++i) { @@ -474,10 +473,7 @@ extern "C" { f_status_t controller_rule_instance_begin(controller_t * const main, controller_cache_t * const cache, const uint8_t options_force, const f_string_static_t alias_rule, const uint8_t action, const uint8_t options, const uint8_t type, const f_number_unsigneds_t stack) { if (!main || !cache) return F_status_set_error(F_parameter); - - if (!controller_thread_is_enabled_instance_type(&main->thread, type)) { - return F_status_set_error(F_interrupt); - } + if (!controller_thread_is_enabled_instance_type(&main->thread, type)) return F_status_set_error(F_interrupt); f_status_t status = controller_lock_read(type != controller_instance_type_exit_e, F_true, &main->thread, &main->thread.lock.instance); @@ -712,7 +708,6 @@ extern "C" { } f_status_t status = F_okay; - f_number_unsigned_t id_rule = 0; const f_number_unsigned_t used_original_stack = instance->stack.used; diff --git a/sources/c/main/rule/parameter.c b/sources/c/main/rule/parameter.c index 303b702..925d1e4 100644 --- a/sources/c/main/rule/parameter.c +++ b/sources/c/main/rule/parameter.c @@ -27,12 +27,9 @@ extern "C" { } if (F_status_is_error_not(state->status)) { - if (content) { - state->status = f_memory_array_increase_by(content->used + 1, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size); - } - else { - state->status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size); - } + state->status = content + ? f_memory_array_increase_by(content->used + 1, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size); + : f_memory_array_increase(controller_allocation_small_d, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size); } if (F_status_is_error(state->status)) { diff --git a/sources/c/main/rule/setting.c b/sources/c/main/rule/setting.c index c7c3ad6..8911a5e 100644 --- a/sources/c/main/rule/setting.c +++ b/sources/c/main/rule/setting.c @@ -120,7 +120,6 @@ extern "C" { f_status_t status_return = F_okay; f_range_t range = macro_f_range_t_initialize_2(cache->buffer_item.used); - f_range_t range2 = f_range_t_initialize; controller_interrupt_t custom = macro_controller_interrupt_t_initialize_1(is_normal, main); f_state_t state = macro_f_state_t_initialize_1(controller_allocation_large_d, controller_allocation_small_d, F_okay, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0); @@ -137,11 +136,12 @@ extern "C" { f_string_dynamics_t *setting_values = 0; f_string_maps_t *setting_maps = 0; + f_range_t range2 = f_range_t_initialize; f_number_unsigned_t i = 0; f_number_unsigned_t j = 0; uint8_t type = 0; uint8_t action = 0; - bool empty_disallow = F_true; + uint8_t empty_disallow = F_true; // Save the current name item and line number to restore on return. const f_number_unsigned_t line_item = cache->action.line_item; diff --git a/sources/c/main/status.c b/sources/c/main/status.c index 14e3e5b..30710e6 100644 --- a/sources/c/main/status.c +++ b/sources/c/main/status.c @@ -45,10 +45,9 @@ extern "C" { case F_valid_not: return F_status_set_error(F_valid_not); - - default: - return F_status_set_error(F_failure); }; + + return F_status_set_error(F_failure); } #endif // _di_controller_status_simplify_error_ diff --git a/sources/c/main/thread/entry.c b/sources/c/main/thread/entry.c index 898da4c..10d15ab 100644 --- a/sources/c/main/thread/entry.c +++ b/sources/c/main/thread/entry.c @@ -211,13 +211,12 @@ extern "C" { // It seems that this function doesn't return to the calling thread for a forked child process, even with the "return 0;" below. if (*status == F_child) { controller_delete(main); - - return 0; } + else { + controller_thread_instance_force_set_disable(main); - controller_thread_instance_force_set_disable(main); - - f_thread_condition_signal_all(&main->thread.lock.alert_condition); + f_thread_condition_signal_all(&main->thread.lock.alert_condition); + } return 0; } -- 1.8.3.1