]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 63333] Be more lenient when failing to create temporary files
authorDmitry Goncharov <dgoncharov@users.sf.net>
Sun, 13 Nov 2022 21:20:33 +0000 (16:20 -0500)
committerPaul Smith <psmith@gnu.org>
Sun, 13 Nov 2022 21:34:01 +0000 (16:34 -0500)
commit1b51ba1f5d448281ddeea5a252814bdec56a86fa
treefeb32c324984b4f3eeae9134811702c94f3d5090
parent4c9d87f4ae938a20fc21d2a0538c74dad0518f20
[SV 63333] Be more lenient when failing to create temporary files

If make cannot create a temporary lock file for output sync, continue
without output sync enabled rather than dying.

However, if make cannot store a makefile from stdin to a temporary
file that is still a fatal error.

* misc.c (get_tmppath): Keep running on failure to generate a
temporary file name.
(get_tmpfd): Keep running on failure to get a temporary file.
(get_tmpfile): Keep running on failure to open a temporary file.
Ensure memory is freed if we return an error.
* posixos.c (os_anontmp): Keep running on failure to open an
anonymous temporary file.
* output.c (setup_tmpfile): Print an error on failure to create an
output sync lock file.
* main.c (main): Die on failure to store makefile from stdin to a
temporary file.
* tests/scripts/features/output-sync: Add tests.
* tests/scripts/features/temp_stdin: Ditto.
src/main.c
src/misc.c
src/output.c
src/posixos.c
tests/scripts/features/output-sync
tests/scripts/features/temp_stdin