Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Dec 2015 09:29:47 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r291763 - stable/10/tests/sys/kern/acct
Message-ID:  <201512040929.tB49TlOf054851@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Fri Dec  4 09:29:47 2015
New Revision: 291763
URL: https://svnweb.freebsd.org/changeset/base/291763

Log:
  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.

Modified:
  stable/10/tests/sys/kern/acct/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tests/sys/kern/acct/Makefile
==============================================================================
--- stable/10/tests/sys/kern/acct/Makefile	Fri Dec  4 09:27:56 2015	(r291762)
+++ stable/10/tests/sys/kern/acct/Makefile	Fri Dec  4 09:29:47 2015	(r291763)
@@ -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>



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