summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Johnson <peter@tortall.net>2011-10-02 23:20:38 -0700
committerPeter Johnson <peter@tortall.net>2011-10-02 23:20:38 -0700
commit2bd66514b6b100887c19d8598da38347b3cff40e (patch)
treef3caebd0edc3e70af9add2b30b4ed9aa10438b6b /tools
parentcc4657a134cc2c2ce9b67626ab0f5ea5c212cf95 (diff)
downloadyasm-2bd66514b6b100887c19d8598da38347b3cff40e.tar.gz
re2c: Use tmpfile instead of fixed temporary filename.
This could cause a race condition when running parallel make. Tracked down by Volker Braun. [#238 state:resolved] [#165 state:resolved]
Diffstat (limited to 'tools')
-rw-r--r--tools/re2c/code.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/re2c/code.c b/tools/re2c/code.c
index a3341cb4..8a78eaa0 100644
--- a/tools/re2c/code.c
+++ b/tools/re2c/code.c
@@ -844,14 +844,13 @@ void DFA_emit(DFA *d, FILE *o){
nOrgOline = oline;
maxFillIndexes = vFillIndexes;
orgVFillIndexes = vFillIndexes;
- tmpo = fopen("re2c.tmp", "wt");
+ tmpo = tmpfile();
for(s = d->head; s; s = s->next){
int readCh = 0;
State_emit(s, tmpo, &readCh);
Go_genGoto(&s->go, tmpo, s, s->next, &readCh);
}
fclose(tmpo);
- remove("re2c.tmp");
maxFillIndexes = vFillIndexes;
vFillIndexes = orgVFillIndexes;
oline = nOrgOline;