mirror of
https://github.com/pissnet/pissircd.git
synced 2025-08-06 18:25:24 +01:00
Fix "ERROR renaming 'data/reputation.db.tmp'" on Windows.
Reported by hc2995, notipa and floffy.
This commit is contained in:
parent
eca761fcb9
commit
27ae0fa340
1 changed files with 4 additions and 0 deletions
|
@ -434,6 +434,10 @@ write_fail:
|
|||
/* Everything went fine. We rename our temporary file to the existing
|
||||
* DB file (will overwrite), which is more or less an atomic operation.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
/* The rename operation cannot be atomic on Windows as it will cause a "file exists" error */
|
||||
unlink(cfg.database);
|
||||
#endif
|
||||
if (rename(tmpfname, cfg.database) < 0)
|
||||
{
|
||||
config_error("ERROR renaming '%s' to '%s': %s -- DATABASE *NOT* SAVED!!!",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue