summaryrefslogtreecommitdiff
path: root/usr.bin/make/meta.c
diff options
context:
space:
mode:
authorsjg <sjg@NetBSD.org>2021-02-05 19:19:17 +0000
committersjg <sjg@NetBSD.org>2021-02-05 19:19:17 +0000
commit9f989261bc4c7e772c8dd03ae5d64a185d173b6d (patch)
tree42e9031c4f354b3d07881db1ce6d506b8935d633 /usr.bin/make/meta.c
parent78c443ced3d1575ec5145b59a68fd55f713909e9 (diff)
Avoid strdup in mkTempFile
Require caller to pass a buffer and size if they want the tempfile not unlinked. Add Job_TempFile to handle blocking signals around call to mkTempFile, so that meta_open_filemon can use it in jobs mode.
Diffstat (limited to 'usr.bin/make/meta.c')
-rw-r--r--usr.bin/make/meta.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/make/meta.c b/usr.bin/make/meta.c
index 104f47d94ed..a12fd049eb3 100644
--- a/usr.bin/make/meta.c
+++ b/usr.bin/make/meta.c
@@ -1,4 +1,4 @@
-/* $NetBSD: meta.c,v 1.176 2021/02/05 05:15:12 rillig Exp $ */
+/* $NetBSD: meta.c,v 1.177 2021/02/05 19:19:17 sjg Exp $ */
/*
* Implement 'meta' mode.
@@ -140,7 +140,10 @@ meta_open_filemon(BuildMon *pbm)
* cwd causing getcwd to do a lot more work.
* We only care about the descriptor.
*/
- pbm->mon_fd = mkTempFile("filemon.XXXXXX", NULL);
+ if (!opts.compatMake)
+ pbm->mon_fd = Job_TempFile("filemon.XXXXXX", NULL, 0);
+ else
+ pbm->mon_fd = mkTempFile("filemon.XXXXXX", NULL, 0);
if ((dupfd = dup(pbm->mon_fd)) == -1) {
err(1, "Could not dup filemon output!");
}