Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Nov 2015 09:15:21 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r291180 - head/tests/sys/kern/acct
Message-ID:  <201511230915.tAN9FLC5099855@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Mon Nov 23 09:15:20 2015
New Revision: 291180
URL: https://svnweb.freebsd.org/changeset/base/291180

Log:
  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.
  
  MFC after: 1 week

Modified:
  head/tests/sys/kern/acct/Makefile

Modified: head/tests/sys/kern/acct/Makefile
==============================================================================
--- head/tests/sys/kern/acct/Makefile	Mon Nov 23 08:52:38 2015	(r291179)
+++ head/tests/sys/kern/acct/Makefile	Mon Nov 23 09:15:20 2015	(r291180)
@@ -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: ${SRCTOP}/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>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511230915.tAN9FLC5099855>