1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-05 19:53:13 +02:00

Use different temporary filename. Not really important normally but

if running multiple ircds from the same directory you sometimes get
weird messages otherwise (not that we really support such a thing
but i use it while dev'ing).
This commit is contained in:
Bram Matthys
2021-03-06 18:53:02 +01:00
parent 94fea88319
commit 17bdd6de1e
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -216,7 +216,7 @@ int write_channeldb(void)
#endif
// Write to a tempfile first, then rename it if everything succeeded
snprintf(tmpfname, sizeof(tmpfname), "%s.tmp", cfg.database);
snprintf(tmpfname, sizeof(tmpfname), "%s.%x.tmp", cfg.database, getrandom32());
fd = fopen(tmpfname, "wb");
if (!fd)
{
+1 -1
View File
@@ -401,7 +401,7 @@ void save_db(void)
#endif
/* We write to a temporary file. Only to rename it later if everything was ok */
snprintf(tmpfname, sizeof(tmpfname), "%s.tmp", cfg.database);
snprintf(tmpfname, sizeof(tmpfname), "%s.%x.tmp", cfg.database, getrandom32());
fd = fopen(tmpfname, "w");
if (!fd)
+1 -1
View File
@@ -255,7 +255,7 @@ int write_tkldb(void)
#endif
// Write to a tempfile first, then rename it if everything succeeded
snprintf(tmpfname, sizeof(tmpfname), "%s.tmp", cfg.database);
snprintf(tmpfname, sizeof(tmpfname), "%s.%x.tmp", cfg.database, getrandom32());
fd = fopen(tmpfname, "wb");
if (!fd)
{