From ef67a4d3c6f172b276f13c3a29e04cfe15630080 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 7 Nov 2022 22:05:54 -0600 Subject: [PATCH] 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. --- level_3/status_code/c/status_code.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 1.8.3.1