Fix some theoretical races in signal handling
commit30ba4a2b69e5ee34c3fcde12f275f80d1fbe8a59
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 6 Aug 2018 21:44:41 +0000 (6 14:44 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 6 Aug 2018 21:45:34 +0000 (6 14:45 -0700)
tree43fdc9cde594e56edf8f29787d1d9e6d9e6cd629
parent1252d056feaf71e7488cbaa5a78b3d45cd77f877
Fix some theoretical races in signal handling

Problem reported by Johannes Przybilla (Bug#32375).
* NEWS: Mention this.
* bootstrap.conf (gnulib_modules): Add sigaction.
* gzip.c (SA_NOCLDSTOP, sigprocmask, sigset_t)
(siginterrupt) [!SA_NOCLDSTOP]: Remove; Gnulib not supplies these.
(remove_ofname): New var.
(volatile_strcpy): New function.
(create_outfile): Use it.
(install_signal_handlers, abort_gzip_signal): Assume sigaction.
(remove_output_file): New arg SIGNALS_ALREADY_BLOCKED.
All uses changed.  Avoid unnecessary (and racy) call
to sigprocmask if this new arg is set.
(abort_gzip_signal): Assume C89 or better for signal handler type.
* gzip.h (RETSIGTYPE): Remove.
* lib/.gitignore, m4/.gitignore:
Add files brought in by Gnulib sigaction module.  Sort.
NEWS
bootstrap.conf
gzip.c
gzip.h
lib/.gitignore
m4/.gitignore