]> Kevux Git Server - controller/commitdiff
Progress: Continue migrating the project.
authorKevin Day <Kevin@kevux.org>
Sun, 14 Jul 2024 04:52:46 +0000 (23:52 -0500)
committerKevin Day <Kevin@kevux.org>
Sun, 14 Jul 2024 04:52:46 +0000 (23:52 -0500)
16 files changed:
sources/c/main/common/type/lock.c
sources/c/main/convert.c
sources/c/main/entry/action.c
sources/c/main/entry/setting.c
sources/c/main/print/output/entry/setting.c
sources/c/main/print/output/rule/validate.c
sources/c/main/process.c
sources/c/main/rule.c
sources/c/main/rule/action.c
sources/c/main/rule/execute.c
sources/c/main/rule/expand.c
sources/c/main/rule/instance.c
sources/c/main/rule/parameter.c
sources/c/main/rule/setting.c
sources/c/main/status.c
sources/c/main/thread/entry.c

index e7e4454e5a8f6fd24082baa0e958acd614f8d4a4..03c53666b4797ce5309a8a32438f5bea8013cc44 100644 (file)
@@ -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_
 
index 59c59cbd5e1d5f62c8e5d47aa11ec3fc2d190726..d6dd6af15a5880b61cc06b2db0779a922edc1853 100644 (file)
@@ -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;
index 7aaf080b2de2046b68a092b3159d5fb783aa6bf6..eb48539e929e4cd88d37ca9dafff903180a9b8ee 100644 (file)
@@ -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;
index 2cfd9e075647317eff10fab1d61b6f1491c509eb..ed0de4021f82163159bc409cf6006995e4ee98bf 100644 (file)
@@ -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;
     }
 
index 6a47d833d929673dc3d9b30e9d358026fc46c2d8..ebe966ad5a32ad3ec531062b1847f4b52f255762 100644 (file)
@@ -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);
index 2ce32c7e34d5b488af6d0237a9f31ead07b9a310..04e26ced4ec5a7b041e0242ad4351a905c14b6a4 100644 (file)
@@ -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;
             }
 
index 17f9267d3433d71b35c19949630e48e8116f3459..29d513a5b7245d08d464b8dfdd85b3e9e4c8b963 100644 (file)
@@ -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);
 
index 0ff8d1e920ad548bfedcf787d5ed12f67631d43c..1f02bb593093602398f17e2118ae86c482dd4a3e 100644 (file)
@@ -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));
     }
index 06ed82bc127f79fe44efd0614edcce62c05e6b8b..d0e8163d822321f6c22f91519d0519f65c1b1c70 100644 (file)
@@ -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;
   }
index c179053811387929b3f2a6dfe67b69ef89882d11..f3a5190fbf14b6ea1bfb28068a444df323955a06 100644 (file)
@@ -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;
           }
 
index e29779f6976f6209521f1a44a310fdebb8b25ab7..bbf71895c4fff778da76ccda2bcff1c90d5fa67c 100644 (file)
@@ -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;
             }
 
index 4a466506b331b498c7778d312ace164026f303e0..c933d6c66d7c1efd1c93917ef9bfd4b83cd53084 100644 (file)
@@ -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;
index 303b702c85837daebe72149928bcca30c0f94c9e..925d1e47b0066e6e880730df40b22fbd0e9b9047 100644 (file)
@@ -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)) {
index c7c3ad6fc87c3cc3dbe552dc38b4d0ea6985177c..8911a5e6d50e08f1e77bb7862c4ef5229ebb5c47 100644 (file)
@@ -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;
index 14e3e5b0aa3126e27fdf252ea5a4b9ce8aca3187..30710e62f93d3ea20827d8d13c9b914f442b90be 100644 (file)
@@ -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_
 
index 898da4c1006e8752c315027c81a9ecc73b4fa6ed..10d15ab6823f409af50024bbb3f0950756ba6c29 100644 (file)
@@ -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;
   }