]> Kevux Git Server - fll/commitdiff
Update: Controller "as init" should use "init" over "controller" in more places.
authorKevin Day <thekevinday@gmail.com>
Thu, 23 Sep 2021 00:33:40 +0000 (19:33 -0500)
committerKevin Day <thekevinday@gmail.com>
Thu, 23 Sep 2021 00:33:40 +0000 (19:33 -0500)
The default settings should be changed to /etc/init/.
The default pid file path should be changed to /var/run/init/init-XXX.pid.

level_3/controller/c/controller.c
level_3/controller/c/controller.h
level_3/controller/c/main.c

index db82e7c3afa60a71448f005ccbce2d314c1c440a..48e59fecdd924d759affbda43332e80a9634ed9d 100644 (file)
@@ -250,7 +250,7 @@ extern "C" {
         status = f_string_append(controller_path_pid_init, controller_path_pid_init_length, &setting.path_pid);
       }
       else {
-        status = f_string_append(controller_path_pid, controller_path_pid_length, &setting.path_pid);
+        status = f_string_append(main->path_pid.string, main->path_pid.used, &setting.path_pid);
       }
 
       if (F_status_is_error_not(status)) {
index 3bb0502425f41e958c939406e0dae8d84ee715fa..fc047568980f9bad50dc9310cc8057073b09bd46 100644 (file)
@@ -114,6 +114,9 @@ extern "C" {
   #if defined(_override_controller_path_pid_init_) && defined(_override_controller_path_pid_init_length_)
     #define controller_path_pid_init         _override_controller_path_pid_init_
     #define controller_path_pid_init_length  _override_controller_path_pid_init_length_
+  #elif defined(_controller_as_init_)
+    #define controller_path_pid_init        "/var/run/init/init-"
+    #define controller_path_pid_init_length 19
   #else
     #define controller_path_pid_init        "/var/run/controller/controller-"
     #define controller_path_pid_init_length 31
@@ -123,6 +126,9 @@ extern "C" {
   #if defined(_override_controller_path_settings_init_) && defined(_override_controller_path_settings_init_length_)
     #define controller_path_settings_init        _override_controller_path_settings_init_
     #define controller_path_settings_init_length _override_controller_path_settings_init_length_
+  #elif defined(_controller_as_init_)
+    #define controller_path_settings_init "/etc/init"
+    #define controller_path_settings_init_length 9
   #else
     #define controller_path_settings_init "/etc/controller"
     #define controller_path_settings_init_length 15
@@ -228,6 +234,7 @@ extern "C" {
     f_string_t program_name;
     f_string_t program_name_long;
     f_string_static_t setting_default;
+    f_string_static_t path_pid;
 
     f_color_context_t context;
   } controller_main_t;
@@ -247,6 +254,7 @@ extern "C" {
       f_string_t_initialize, \
       f_string_t_initialize, \
       f_string_static_t_initialize, \
+      f_string_static_t_initialize, \
       f_color_context_t_initialize, \
     }
 #endif // _di_controller_main_t_
index 3f930bb128801d54ee262b8fc3daf70fa86d6a42..d68197a3b654fd5d61199668c99f74b4708a6e40 100644 (file)
@@ -41,9 +41,13 @@ int main(const int argc, const f_string_t *argv) {
     data.program_name_long = controller_name_init_long;
     data.setting_default.string = controller_path_settings_init;
     data.setting_default.used = controller_path_settings_init_length;
+    data.path_pid.string = controller_path_pid_init;
+    data.path_pid.used = controller_path_pid_init_length;
   #else // _controller_as_init_
     data.program_name = controller_name;
     data.program_name_long = controller_name_long;
+    data.path_pid.string = controller_path_pid;
+    data.path_pid.used = controller_path_pid_length;
   #endif // _controller_as_init_
 
   status = controller_main(arguments, &data);