summaryrefslogtreecommitdiff
path: root/src/makeint.h
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2022-10-15 16:34:54 -0400
committerPaul Smith <psmith@gnu.org>2022-10-15 18:39:32 -0400
commit18c4b508ef24596470b64ddf058c0115ac75fbc2 (patch)
tree70410cfe71c32ac0235089e24fe02fa970bcef49 /src/makeint.h
parent383eb3a923b95ee9959446a03e34d870f9d1f427 (diff)
downloadmake-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.h1
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 *);