summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-12-04 09:29:47 +0000
committerngie <ngie@FreeBSD.org>2015-12-04 09:29:47 +0000
commit634df7f08c142512043084b495106ce19badc5a8 (patch)
tree94ea7c6b62e761822a52c9d0d4b04a3845f5d86f /tests
parent6091b946282d337c56f654bae482a19997be358a (diff)
downloadFreeBSD-src-634df7f08c142512043084b495106ce19badc5a8.zip
FreeBSD-src-634df7f08c142512043084b495106ce19badc5a8.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/sys/kern/acct/Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/sys/kern/acct/Makefile b/tests/sys/kern/acct/Makefile
index e0e2363..51f523d 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 <bsd.test.mk>
OpenPOWER on IntegriCloud