summaryrefslogtreecommitdiff
path: root/src/output.c
diff options
context:
space:
mode:
authorDmitry Goncharov <dgoncharov@users.sf.net>2022-11-13 16:20:33 -0500
committerPaul Smith <psmith@gnu.org>2022-11-13 16:34:01 -0500
commit1b51ba1f5d448281ddeea5a252814bdec56a86fa (patch)
treefeb32c324984b4f3eeae9134811702c94f3d5090 /src/output.c
parent4c9d87f4ae938a20fc21d2a0538c74dad0518f20 (diff)
downloadmake-git-1b51ba1f5d448281ddeea5a252814bdec56a86fa.tar.gz
[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.
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/output.c b/src/output.c
index 43eb2f06..22387dff 100644
--- a/src/output.c
+++ b/src/output.c
@@ -248,6 +248,9 @@ setup_tmpfile (struct output *out)
/* If we failed to create a temp file, disable output sync going forward. */
error:
+ O (error, NILF,
+ _("cannot open output-sync lock file, suppressing output-sync."));
+
output_close (out);
output_sync = OUTPUT_SYNC_NONE;
osync_clear ();