aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2014-01-22 21:38:31 +0200
committerEli Zaretskii <[email protected]>2014-01-22 21:38:31 +0200
commit7a49c9d615d91efc1e65ef1d1367b1a5c076ac96 (patch)
treeda7083f2c92fc9900bfd4d3485b4704a53a84816 /lib-src
parente2a095b16ffb909bf835516098bac8ae6f075992 (diff)
Fix MS-Windows build in lib-src broken by last commit.
lib-src/update-game-score.c (write_scores) [WINDOWSNT]: Use chmod instead of fchmod.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/update-game-score.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 0d06a926ba..6f4f3cd86e 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
+2014-01-22 Eli Zaretskii <[email protected]>
+
+ * update-game-score.c (write_scores) [WINDOWSNT]: Use chmod
+ instead of fchmod.
+
2014-01-22 Paul Eggert <[email protected]>
Fix miscellaneous update-game-score bugs.
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index d9218ff67b..ad591cca87 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -443,8 +443,10 @@ write_scores (const char *filename, const struct score_entry *scores,
fd = mkostemp (tempfile, 0);
if (fd < 0)
return -1;
+#ifndef WINDOWSNT
if (fchmod (fd, 0644) != 0)
return -1;
+#endif
f = fdopen (fd, "w");
if (! f)
return -1;
@@ -457,6 +459,10 @@ write_scores (const char *filename, const struct score_entry *scores,
return -1;
if (rename (tempfile, filename) != 0)
return -1;
+#ifdef WINDOWSNT
+ if (chmod (filename, 0644) < 0)
+ return -1;
+#endif
return 0;
}