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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user