diff options
author | Paul Smith <psmith@gnu.org> | 2022-10-15 16:34:54 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-10-15 18:39:32 -0400 |
commit | 18c4b508ef24596470b64ddf058c0115ac75fbc2 (patch) | |
tree | 70410cfe71c32ac0235089e24fe02fa970bcef49 /src/makeint.h | |
parent | 383eb3a923b95ee9959446a03e34d870f9d1f427 (diff) | |
download | make-git-18c4b508ef24596470b64ddf058c0115ac75fbc2.tar.gz |
[SV 63157] Ensure temporary files are removed when signaled
Original patch from Dmitry Goncharov <dgoncharov@users.sf.net>.
When handling a fatal signal ensure the temporary files for
stdin and the jobserver fifo (if in use) are deleted.
* src/makeint.h (temp_stdin_unlink): Declare a new method.
* src/main.c (temp_stdin_unlink): Delete the stdin temporary file
if it exists. If the unlink fails and we're not handling a signal
then show an error.
(main): Call temp_stdin_unlink() instead of unlinking by hand.
* src/commands.c (fatal_error_signal): Invoke cleanup methods if
we're handling a fatal signal.
* tests/scripts/features/output-sync: Test signal handling during
output sync and jobserver with FIFO.
* tests/scripts/features/temp_stdin: Test signal handling when
makefiles are read from stdin.
Diffstat (limited to 'src/makeint.h')
-rw-r--r-- | src/makeint.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/makeint.h b/src/makeint.h index 2da2a6fd..89a5f770 100644 --- a/src/makeint.h +++ b/src/makeint.h @@ -545,6 +545,7 @@ void out_of_memory () NORETURN; (_f), (_n), (_s)) void decode_env_switches (const char*, size_t line); +void temp_stdin_unlink (void); void die (int) NORETURN; void pfatal_with_name (const char *) NORETURN; void perror_with_name (const char *, const char *); |