]> jfr.im git - irc/blitzed-org/atheme.git/commitdiff
backend/opensex: use srename().
authorWilliam Pitcock <redacted>
Sun, 11 Mar 2012 03:56:21 +0000 (21:56 -0600)
committerWilliam Pitcock <redacted>
Sun, 11 Mar 2012 03:56:21 +0000 (21:56 -0600)
modules/backend/opensex.c

index 38767e4985ffdf2f639721a15c1bd1d5dac5ebc9..571ede4b9dda9325fdc5c02fbaa8abe95ff96c53 100644 (file)
@@ -1235,11 +1235,7 @@ static void opensex_db_close(database_handle_t *db)
        if (db->txn == DB_WRITE)
        {
                /* now, replace the old database with the new one, using an atomic rename */
-#ifdef _WIN32
-               unlink(newpath);
-#endif
-
-               if (rename(oldpath, newpath) < 0)
+               if (srename(oldpath, newpath) < 0)
                {
                        errno1 = errno;
                        slog(LG_ERROR, "db_save(): cannot rename services.db.new to services.db: %s", strerror(errno1));