]> Kevux Git Server - fll/commitdiff
Bugfix: Output stream is not properly unlocked on signal.
authorKevin Day <thekevinday@gmail.com>
Tue, 8 Nov 2022 04:05:54 +0000 (22:05 -0600)
committerKevin Day <thekevinday@gmail.com>
Tue, 8 Nov 2022 04:05:54 +0000 (22:05 -0600)
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

index e88093f9c3e2412ab43154754f26ed5b158f0357..44d362432084fd47324fc7ba61a74991a74fcb28 100644 (file)
@@ -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);