From e84488b02c61d11da3f17362283ed6fca8bef896 Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 4 Dec 2015 09:29:47 +0000 Subject: [PATCH] MFC r291180: Fix up convert.c generation - Use a temporary file for convert.c to reduce likelihood of an interrupted build resulting in bad code being written to convert.c - Truncate the file instead of appending to it to ensure that the file being touched will not result in duplicate declarations/definitions from kern_acct.c if/when kern_acct.c changes. git-svn-id: svn://svn.freebsd.org/base/stable/10@291763 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- tests/sys/kern/acct/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/acct/Makefile b/tests/sys/kern/acct/Makefile index e0e2363f8..51f523d7f 100644 --- a/tests/sys/kern/acct/Makefile +++ b/tests/sys/kern/acct/Makefile @@ -6,12 +6,13 @@ ATF_TESTS_C= acct_test CFLAGS+= -I${.OBJDIR} -CLEANFILES+= convert.c +CLEANFILES+= convert.c convert.c.tmp DPSRCS.acct_test= convert.c convert.c: ${.CURDIR:H:H:H:H}/sys/kern/kern_acct.c sed -n -e 's/log(/syslog(/g' \ - -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' ${.ALLSRC} >>${.TARGET} + -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' ${.ALLSRC} >${.TARGET}.tmp + mv ${.TARGET}.tmp ${.TARGET} .include -- 2.45.0