aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/ratings.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-04-05 14:44:51 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-04-05 14:44:51 +0200
commit0606811447488e46fdcec1e3b6d27cd666cb664d (patch)
tree94eb9474da47107ad8f4f7c553ee7cdc2e6ebd73 /FICS/ratings.c
parent43465762bd19bdd4cc72e41e03e69dba66f96ea7 (diff)
Added usage of rename()
Diffstat (limited to 'FICS/ratings.c')
-rw-r--r--FICS/ratings.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/FICS/ratings.c b/FICS/ratings.c
index 2eaa5c2..7403256 100644
--- a/FICS/ratings.c
+++ b/FICS/ratings.c
@@ -1465,8 +1465,17 @@ UpdateRank(int type, char *addName, statistics *sNew, char *delName)
fclose(fp);
// XXX
+#define NASH_CODE 0
+#if NASH_CODE
snprintf(command, sizeof command, "mv %s %s", TmpRankFile, RankFile);
system(command);
+#else
+ if (rename(TmpRankFile, RankFile) == -1) {
+ (void) fprintf(stderr, "FICS: %s: warning: rename(): %s",
+ __func__, strerror(errno));
+ }
+ UNUSED_VAR(command);
+#endif
}
PRIVATE void