]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Set the proper type for variables set in signal handlers
authorPaul Smith <psmith@gnu.org>
Sun, 9 Oct 2022 17:41:21 +0000 (13:41 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 15 Oct 2022 22:39:32 +0000 (18:39 -0400)
* bootstrap.conf: Get gnulib's sig_atomic_t type checking M4 macro.
* configure.ac: Invoke it.
* src/makeint.h (handling_fatal_signal): Set the type correctly.
* src/commands.c (handling_fatal_signal): Ditto.

bootstrap.conf
configure.ac
src/commands.c
src/makeint.h

index 1dc096db005c5e771547cba654ba1cbeba896080..a8b8b8d5254dc744f5d1149bcbab4a865675eacb 100644 (file)
@@ -47,7 +47,7 @@ automake   1.16.1
 "
 
 gnulib_name=libgnu
-gnulib_files=doc/make-stds.texi
+gnulib_files="doc/make-stds.texi m4/sig_atomic_t.m4"
 
 # Using the full strtoll module pulls in a lot of stuff.  But, it's pretty
 # simple to use just the base source file, so pull that.  We'll use it in
index 2f5d9810618bce64b13b830a6594f65a95e61d06..e953bf1a6b94a5520ede7a3121f1c795d004fdb9 100644 (file)
@@ -78,6 +78,9 @@ AC_TYPE_SSIZE_T
 AC_TYPE_INTMAX_T
 AC_TYPE_UINTMAX_T
 
+# Check for sig_atomic_t
+gt_TYPE_SIG_ATOMIC_T
+
 # Find out whether our struct stat returns nanosecond resolution timestamps.
 
 AC_STRUCT_ST_MTIM_NSEC
index e7c0cc87f11d23c89822eb33da4be463b9a31f43..13d98ff96272032cb25bf112a2ba8b3e34fcfdd0 100644 (file)
@@ -479,7 +479,7 @@ execute_file_commands (struct file *file)
 /* This is set while we are inside fatal_error_signal,
    so things can avoid nonreentrant operations.  */
 
-int handling_fatal_signal = 0;
+volatile sig_atomic_t handling_fatal_signal = 0;
 
 /* Handle fatal signals.  */
 
index 0bc41eb1dcad94c7921ffefc06abd7499604964f..2da2a6fd4204bc2c643f6d5950b18408bdc618f0 100644 (file)
@@ -791,7 +791,7 @@ extern char *version_string, *remote_description, *make_host;
 
 extern unsigned int commands_started;
 
-extern int handling_fatal_signal;
+extern volatile sig_atomic_t handling_fatal_signal;
 
 #ifndef MIN
 #define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))