]> Kevux Git Server - fll/commitdiff
Cleanup: don't re-use 'result' variable name, and fix documentation.
authorKevin Day <thekevinday@gmail.com>
Wed, 10 Feb 2021 05:13:07 +0000 (23:13 -0600)
committerKevin Day <thekevinday@gmail.com>
Wed, 10 Feb 2021 05:13:07 +0000 (23:13 -0600)
level_2/fll_execute/c/execute.h
level_2/fll_execute/c/private-execute.c

index 7b9c3000e53502208ac961cd663e7bef3011fdba..e958a9c04dd0be538d3555e49e8b1d6894e952e1 100644 (file)
@@ -487,11 +487,11 @@ extern "C" {
  * @see f_file_exists()
  * @see f_limit_process()
  * @see f_signal_mask()
+ * @see f_string_append()
+ * @see f_string_dynamic_terminate()
  * @see f_thread_signal_mask()
  * @see fl_control_group_apply()
  * @see fl_environment_path_explode_dynamic()
- * @see f_string_append()
- * @see f_string_dynamic_terminate()
  */
 #ifndef _di_fll_execute_program_
   extern f_status_t fll_execute_program(const f_string_t program, const f_string_statics_t arguments, fl_execute_parameter_t * const parameter, fl_execute_as_t * const as, int *result);
index 3bf527d435bea491d7d1434e843cb1b3a53991d2..05c36d3abd715f936d859c667d3f46ad65fc695c 100644 (file)
@@ -287,18 +287,16 @@ extern "C" {
 
           const f_file_t file = f_macro_file_t_initialize2(0, descriptors[1], f_file_flag_write_only);
 
-          f_string_static_t result = f_string_static_t_initialize;
+          f_string_static_t buffer = f_string_static_t_initialize;
 
-          result.string = string_result;
-          result.used = 1;
-          result.size = 2;
+          buffer.string = string_result;
+          buffer.used = 1;
+          buffer.size = 2;
 
           const f_status_t status = private_fll_execute_as_parent(*as, id_process, parameter, string_result);
 
           // inform the child that it can now safely begin (or exit).
-          if (F_status_is_error(f_file_write(file, result, 0))) {
-            string_result[0] = '1';
-          }
+          f_file_write(file, buffer, 0);
 
           // close the write pipe for the parent when finished writing.
           close(descriptors[1]);
@@ -451,16 +449,16 @@ extern "C" {
 
         // have the parent perform all appropriate access controls and then send either '0' for no error or '1' for error to the child.
         if (as) {
-          f_string_static_t result = f_string_static_t_initialize;
+          f_string_static_t buffer = f_string_static_t_initialize;
 
-          result.string = string_result;
-          result.used = 1;
-          result.size = 2;
+          buffer.string = string_result;
+          buffer.used = 1;
+          buffer.size = 2;
 
           status = private_fll_execute_as_parent(*as, id_process, parameter, string_result);
 
           // inform the child that it can now safely begin (or exit).
-          if (F_status_is_error(f_file_write(file, result, 0))) {
+          if (F_status_is_error(f_file_write(file, buffer, 0))) {
             string_result[0] = '1';
           }
         }