I had forgotten that this is already optional.
Change the design to detect when pid file is explicitly disabled (passing an empty string to "--pid").
This avoids the need for the process_pid variable.
}
}
else {
- main->process_pid = F_false;
+ setting.path_pid.used = 0;
}
}
}
- if (F_status_is_error_not(status) && !setting.path_pid.used && main->process_pid) {
+ if (F_status_is_error_not(status) && !setting.path_pid.used && !main->parameters[controller_parameter_pid].locations.used) {
if (main->parameters[controller_parameter_init].result == f_console_result_found) {
status = f_string_append(controller_path_pid_init, controller_path_pid_init_length, &setting.path_pid);
f_array_lengths_t remaining;
bool process_pipe;
- bool process_pid;
bool as_init;
f_file_t output;
controller_console_parameter_t_initialize, \
f_array_lengths_t_initialize, \
F_false, \
- F_true, \
F_false, \
macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
// when run as "init" by default, provide the default system-level init path.
// this change must only exist within this main file so that the change only exists within the program rather than the library.
#ifdef _controller_as_init_
- data.process_pid = F_false;
data.program_name = controller_name_init;
data.program_name_long = controller_name_init_long;
data.setting_default.string = controller_path_settings_init;
f_status_t status = F_none;
// only create pid file when not in validate mode.
- if (is_entry && global.main->parameters[controller_parameter_validate].result == f_console_result_none && global.main->process_pid) {
+ if (is_entry && global.main->parameters[controller_parameter_validate].result == f_console_result_none && global.setting->path_pid.used) {
status = controller_file_pid_create(global.main->pid, global.setting->path_pid);