Set the proper type for variables set in signal handlers

* 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.
This commit is contained in:
Paul Smith 2022-10-09 13:41:21 -04:00
parent bf2d71498c
commit 01b1d4f401
4 changed files with 6 additions and 3 deletions

View 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

View 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

View 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. */

View 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))