]> Kevux Git Server - fll/commitdiff
Update: The threaded signal handler to avoid signal id races.
authorKevin Day <Kevin@kevux.org>
Fri, 24 Jan 2025 02:57:11 +0000 (20:57 -0600)
committerKevin Day <Kevin@kevux.org>
Fri, 24 Jan 2025 03:02:46 +0000 (21:02 -0600)
Apply the same anti-race improvements implemented on the non-threaded signal checker to the threaded signal checker.

Still check for a negative id to prevent the signal message from being printed more than once.

level_3/example/c/main/signal.c
level_3/fake/c/main/signal.c
level_3/firewall/c/main/signal.c
level_3/fss_identify/c/main/signal.c
level_3/fss_read/c/main/signal.c
level_3/fss_write/c/main/signal.c
level_3/iki_read/c/main/signal.c
level_3/iki_write/c/main/signal.c
level_3/status_code/c/main/signal.c
level_3/utf8/c/main/signal.c

index 624db5f9a9f70b38c77ef731dbe866a959f590bf..3ee3fab9b7b33a6ff0953a12197728097f86293b 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #if !defined(_di_example_signal_check_) && !defined(_di_thread_support_)
   f_status_t example_signal_check(example_main_t * const main) {
 
-    if (!main || main->program.signal.id == -1) return F_false;
+    if (!main) return F_false;
 
     if (main->program.signal_received) {
       fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
index dfb48cc65d376b55abfd8d5906bf9f1cdf5ec2e7..d0c1fe4c4c7b95c6b2d21c449dea5735d77c43b9 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #if !defined(_di_fake_signal_check_) && !defined(_di_thread_support_)
   f_status_t fake_signal_check(fake_main_t * const main) {
 
-    if (!main || main->program.signal.id == -1) return F_false;
+    if (!main) return F_false;
 
     if (main->program.signal_received) {
       fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
index e35882eefb7850c40927f8e6ef70f9b0b0fdaf42..7711f7489e5787f20142d2f63ab2d6a9346d9361 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #if !defined(_di_firewall_signal_check_) && !defined(_di_thread_support_)
   f_status_t firewall_signal_check(firewall_main_t * const main) {
 
-    if (!main || main->program.signal.id == -1) return F_false;
+    if (!main) return F_false;
 
     if (main->program.signal_received) {
       fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
index 61262d73280b98143b9268bd341e18a1a8677d6c..b633959fa4c8d01e2ea9b9861d3c98ef1336d891 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #if !defined(_di_fss_identify_signal_check_) && !defined(_di_thread_support_)
   f_status_t fss_identify_signal_check(fss_identify_main_t * const main) {
 
-    if (!main || main->program.signal.id == -1) return F_false;
+    if (!main) return F_false;
 
     if (main->program.signal_received) {
       fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
index 023cb5b6b6ef2315221e0685b283a097d74ecc1c..8dc4ea2568bc1a83e7bea386286fc61aff626674 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #if !defined(_di_fss_read_signal_check_) && !defined(_di_thread_support_)
   f_status_t fss_read_signal_check(fss_read_main_t * const main) {
 
-    if (!main || main->program.signal.id == -1) return F_false;
+    if (!main) return F_false;
 
     if (main->program.signal_received) {
       fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
index 2b45589371ffe2c9ad91651d75446b5f393902a8..37027cea9054fa5e89873625b036000a689956ee 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #if !defined(_di_fss_write_signal_check_) && !defined(_di_thread_support_)
   f_status_t fss_write_signal_check(fss_write_main_t * const main) {
 
-    if (!main || main->program.signal.id == -1) return F_false;
+    if (!main) return F_false;
 
     if (main->program.signal_received) {
       fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
index 56cc1ebe8715bdd5a85199131f7fe16b7f3b1e66..36854ea50fc6b17146af4f7faa8c09303ccdea1b 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #if !defined(_di_iki_read_signal_check_) && !defined(_di_thread_support_)
   f_status_t iki_read_signal_check(iki_read_main_t * const main) {
 
-    if (!main || main->program.signal.id == -1) return F_false;
+    if (!main) return F_false;
 
     if (main->program.signal_received) {
       fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
index 6357e754fd693d66923690b9d9480276f3e1f640..8bf9e3883dbac494248a088ce0afb8c0c14d1068 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #if !defined(_di_iki_write_signal_check_) && !defined(_di_thread_support_)
   f_status_t iki_write_signal_check(iki_write_main_t * const main) {
 
-    if (!main || main->program.signal.id == -1) return F_false;
+    if (!main) return F_false;
 
     if (main->program.signal_received) {
       fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
index 183446b7ad74f152126f861e99c8d27d9a20694a..3aaea4afb0d6c1c25f393185962239e4e35e1fb4 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #if !defined(_di_status_code_signal_check_) && !defined(_di_thread_support_)
   f_status_t status_code_signal_check(status_code_main_t * const main) {
 
-    if (!main || main->program.signal.id == -1) return F_false;
+    if (!main) return F_false;
 
     if (main->program.signal_received) {
       fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
index fbe1248ceec6d51c4d52bc5606d47095a950c943..64f391d7d9230ebabacd825199e04cf85041e724 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #if !defined(_di_utf8_signal_check_) && !defined(_di_thread_support_)
   f_status_t utf8_signal_check(utf8_main_t * const main) {
 
-    if (!main || main->program.signal.id == -1) return F_false;
+    if (!main) return F_false;
 
     if (main->program.signal_received) {
       fll_program_print_signal_received(&main->program.warning, main->program.signal_received);