From: Kevin Day Date: Tue, 8 Nov 2022 04:05:54 +0000 (-0600) Subject: Bugfix: Output stream is not properly unlocked on signal. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=ef67a4d3c6f172b276f13c3a29e04cfe15630080;p=fll Bugfix: Output stream is not properly unlocked on signal. The output stream is locked during some loops. When an appropriate signal is received while in one of these loops, the program exits. The output stream must be unlocked before returning. --- diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index e88093f..44d3624 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -39,6 +39,8 @@ extern "C" { if (!((++main->signal_check) % status_code_signal_check_d)) { if (fll_program_standard_signal_received(main)) { + f_file_stream_unlock(main->output.to); + fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received); setting->status = F_status_set_error(F_interrupt); @@ -71,6 +73,8 @@ extern "C" { if (!((++main->signal_check) % status_code_signal_check_d)) { if (fll_program_standard_signal_received(main)) { + f_file_stream_unlock(main->output.to); + fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received); setting->status = F_status_set_error(F_interrupt); @@ -103,6 +107,8 @@ extern "C" { if (!((++main->signal_check) % status_code_signal_check_d)) { if (fll_program_standard_signal_received(main)) { + f_file_stream_unlock(main->output.to); + fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received); setting->status = F_status_set_error(F_interrupt);