Mark two signal flags as sig_atomic_t in pgbench and pg_test_fsync
authorMichael Paquier <michael@paquier.xyz>
Sat, 26 Nov 2022 11:12:33 +0000 (20:12 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sat, 26 Nov 2022 11:12:33 +0000 (20:12 +0900)
Two booleans used for timeout tracking were used within some SIGALRM
signal handlers, but they were not declared as sig_atomic_t, so mark
them as such.  This has no consequence on WIN32 for both tools.

Author: Ranier Vilela
Reviewed-by: Michael Paquier, Masahiko Sawada
Discussion: https://postgr.es/m/CAEudQArCDQQiPiFR16=yu9k5s2tp4tgEe1U1ZbkW4ofx81AWWQ@mail.gmail.com

src/bin/pg_test_fsync/pg_test_fsync.c
src/bin/pgbench/pgbench.c

index 5f8cbb75ffd4da3b324da5d1a1d39b8bc890fff9..3d5e8f30ab79e6aa1e856bc3ae3e1ab14777ec01 100644 (file)
@@ -68,7 +68,7 @@ static char full_buf[DEFAULT_XLOG_SEG_SIZE],
           *filename = FSYNC_FILENAME;
 static struct timeval start_t,
            stop_t;
-static bool alarm_triggered = false;
+static sig_atomic_t alarm_triggered = false;
 
 
 static void handle_args(int argc, char *argv[]);
index 36905a896817858db15a954057a2e21b5a64e42a..ee1a33c9ee88230c9b8dff46538895e0f9c764ab 100644 (file)
@@ -310,7 +310,7 @@ const char *progname;
 
 #define WSEP '@'               /* weight separator */
 
-volatile bool timer_exceeded = false;  /* flag from signal handler */
+volatile sig_atomic_t timer_exceeded = false;  /* flag from signal handler */
 
 /*
  * We don't want to allocate variables one by one; for efficiency, add a