]> Kevux Git Server - fll/commitdiff
Update: Use the signal check counter more consistently in Featureless Make.
authorKevin Day <kevin@kevux.org>
Sun, 5 Mar 2023 02:15:40 +0000 (20:15 -0600)
committerKevin Day <kevin@kevux.org>
Sun, 5 Mar 2023 02:18:34 +0000 (20:18 -0600)
There are areas in the code where the signal is being checked without utilizing the counter.

level_3/fake/c/private-build-load.c
level_3/fake/c/private-build.c
level_3/fake/c/private-fake.c
level_3/fake/c/private-make-operate.c

index 9172b8e2a6c37590a0bb477af2e619f627f68f8f..9c938265502eb8ce899de819cb53e45dac2e7c23 100644 (file)
@@ -74,12 +74,14 @@ extern "C" {
 
     if (F_status_is_error(*status)) return;
 
-    if (fll_program_standard_signal_received(data->main)) {
-      fake_print_signal_received(data);
+    if (!((++data->main->signal_check) % fake_signal_check_d)) {
+      if (fll_program_standard_signal_received(data->main)) {
+        fake_print_signal_received(data);
 
-      *status = F_status_set_error(F_interrupt);
+        *status = F_status_set_error(F_interrupt);
 
-      return;
+        return;
+      }
     }
 
     // Strip the build settings name from the build arguments to generate a list of modes.
@@ -230,12 +232,14 @@ extern "C" {
 
     if (F_status_is_error(*status) && buffer.used) return;
 
-    if (fll_program_standard_signal_received(data->main)) {
-      fake_print_signal_received(data);
+    if (!((++data->main->signal_check) % fake_signal_check_d)) {
+      if (fll_program_standard_signal_received(data->main)) {
+        fake_print_signal_received(data);
 
-      *status = F_status_set_error(F_interrupt);
+        *status = F_status_set_error(F_interrupt);
 
-      return;
+        return;
+      }
     }
 
     bool error_printed = F_false;
@@ -1478,12 +1482,14 @@ extern "C" {
 
     if (F_status_is_error(*status)) return;
 
-    if (fll_program_standard_signal_received(data->main)) {
-      fake_print_signal_received(data);
+    if (!((++data->main->signal_check) % fake_signal_check_d)) {
+      if (fll_program_standard_signal_received(data->main)) {
+        fake_print_signal_received(data);
 
-      *status = F_status_set_error(F_interrupt);
+        *status = F_status_set_error(F_interrupt);
 
-      return;
+        return;
+      }
     }
 
     const f_string_static_t names[] = {
index 8139a7c9b2bf06f2a76984136eb9c7b5085b2fb3..b364a236ecd069d263bd02c6295e9e704acb4dc0 100644 (file)
@@ -348,12 +348,14 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static
 
     if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return;
 
-    if (fll_program_standard_signal_received(data->main)) {
-      fake_print_signal_received(data);
+    if (!((++data->main->signal_check) % fake_signal_check_d)) {
+      if (fll_program_standard_signal_received(data->main)) {
+        fake_print_signal_received(data);
 
-      *status = F_status_set_error(F_interrupt);
+        *status = F_status_set_error(F_interrupt);
 
-      return;
+        return;
+      }
     }
 
     f_directory_statuss_t failures = f_directory_statuss_t_initialize;
@@ -393,7 +395,7 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static
 
     for (f_array_length_t i = 0; i < files.used; ++i) {
 
-      if (!(i % fake_signal_check_short_d)) {
+      if (!((++data->main->signal_check) % fake_signal_check_short_d)) {
         if (fll_program_standard_signal_received(data->main)) {
           fake_print_signal_received(data);
 
@@ -714,7 +716,7 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static
 
     f_string_dynamics_resize(0, &arguments);
 
-    if (fll_program_standard_signal_received(data->main)) {
+    if (!((++data->main->signal_check) % fake_signal_check_d) && fll_program_standard_signal_received(data->main)) {
       fake_print_signal_received(data);
 
       *status = F_status_set_error(F_interrupt);
@@ -818,10 +820,12 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static
 #ifndef _di_fake_build_operate_
   f_status_t fake_build_operate(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe) {
 
-    if (fll_program_standard_signal_received(data->main)) {
-      fake_print_signal_received(data);
+    if (!((++data->main->signal_check) % fake_signal_check_d)) {
+      if (fll_program_standard_signal_received(data->main)) {
+        fake_print_signal_received(data);
 
-      return F_status_set_error(F_interrupt);
+        return F_status_set_error(F_interrupt);
+      }
     }
 
     f_status_t status = F_none;
@@ -1134,12 +1138,14 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static
 
     if (F_status_is_error(*status)) return;
 
-    if (fll_program_standard_signal_received(data->main)) {
-      fake_print_signal_received(data);
+    if (!((++data->main->signal_check) % fake_signal_check_d)) {
+      if (fll_program_standard_signal_received(data->main)) {
+        fake_print_signal_received(data);
 
-      *status = F_status_set_error(F_interrupt);
+        *status = F_status_set_error(F_interrupt);
 
-      return;
+        return;
+      }
     }
 
     f_mode_t mode = f_mode_t_initialize;
index 09b19b7a5170f1f0756821a714dd20c946f5034a..ddf29061fad004c2a955bcc9570b1f93af31dab6 100644 (file)
@@ -45,12 +45,14 @@ extern "C" {
 
       *status = fll_execute_program(program, arguments, &parameter, 0, (void *) &return_code);
 
-      if (fll_program_standard_signal_received(data->main)) {
-        fake_print_signal_received(data);
+      if (!((++data->main->signal_check) % fake_signal_check_d)) {
+        if (fll_program_standard_signal_received(data->main)) {
+          fake_print_signal_received(data);
 
-        *status = F_status_set_error(F_interrupt);
+          *status = F_status_set_error(F_interrupt);
 
-        return 0;
+          return 0;
+        }
       }
 
       if (*status == F_child) return return_code;
@@ -88,10 +90,12 @@ extern "C" {
 #ifndef _di_fake_file_buffer_
   f_status_t fake_file_buffer(fake_data_t * const data, const f_string_static_t path_file, const bool required, f_string_dynamic_t * const buffer) {
 
-    if (fll_program_standard_signal_received(data->main)) {
-      fake_print_signal_received(data);
+    if (!((++data->main->signal_check) % fake_signal_check_d)) {
+      if (fll_program_standard_signal_received(data->main)) {
+        fake_print_signal_received(data);
 
-      return F_status_set_error(F_interrupt);
+        return F_status_set_error(F_interrupt);
+      }
     }
 
     f_file_t file = f_file_t_initialize;
@@ -171,10 +175,12 @@ extern "C" {
     clearerr(F_type_input_d);
 
     do {
-      if (fll_program_standard_signal_received(data->main)) {
-        fake_print_signal_received(data);
+      if (!((++data->main->signal_check) % fake_signal_check_d)) {
+        if (fll_program_standard_signal_received(data->main)) {
+          fake_print_signal_received(data);
 
-        return F_status_set_error(F_interrupt);
+          return F_status_set_error(F_interrupt);
+        }
       }
 
       status = f_file_stream_read_block(file, buffer);
@@ -552,10 +558,12 @@ extern "C" {
 #ifndef _di_fake_validate_parameter_paths_
   f_status_t fake_validate_parameter_paths(fake_data_t * const data) {
 
-    if (fll_program_standard_signal_received(data->main)) {
-      fake_print_signal_received(data);
+    if (!((++data->main->signal_check) % fake_signal_check_d)) {
+      if (fll_program_standard_signal_received(data->main)) {
+        fake_print_signal_received(data);
 
-      return F_status_set_error(F_interrupt);
+        return F_status_set_error(F_interrupt);
+      }
     }
 
     const f_string_static_t names[] = {
index bf789ccf2a9705a638bda1fe5e6a3c9ecfe2adc9..6feafad85d07352a5a58256c5fc3879d0e858135 100644 (file)
@@ -16,10 +16,12 @@ extern "C" {
 #ifndef _di_fake_make_operate_
   f_status_t fake_make_operate(fake_data_t * const data) {
 
-    if (fll_program_standard_signal_received(data->main)) {
-      fake_print_signal_received(data);
+    if (!((++data->main->signal_check) % fake_signal_check_d)) {
+      if (fll_program_standard_signal_received(data->main)) {
+        fake_print_signal_received(data);
 
-      return F_status_set_error(F_interrupt);
+        return F_status_set_error(F_interrupt);
+      }
     }
 
     if (data->main->output.verbosity != f_console_verbosity_quiet_e && data->main->output.verbosity != f_console_verbosity_error_e) {