From d3c495e8b99a385231720358f5f4464866cd3ea8 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 16 Feb 2021 22:19:34 +0100 Subject: [PATCH] ar65: fix parallel builds by using a per-process temp file --- src/ar65/library.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ar65/library.c b/src/ar65/library.c index 08fdeb563..fd761d04e 100644 --- a/src/ar65/library.c +++ b/src/ar65/library.c @@ -249,9 +249,10 @@ void LibOpen (const char* Name, int MustExist, int NeedTemp) if (NeedTemp) { /* Create the temporary library name */ - NewLibName = xmalloc (strlen (Name) + strlen (".temp") + 1); + NewLibName = xmalloc (strlen (Name) + strlen (".temp-") + 8 + 1); strcpy (NewLibName, Name); - strcat (NewLibName, ".temp"); + strcat (NewLibName, ".temp-"); + sprintf (NewLibName + strlen (NewLibName), "%X", (unsigned int)getpid()); /* Create the temporary library */ NewLib = fopen (NewLibName, "w+b");