diff options
Diffstat (limited to 'lib-src/update-game-score.c')
-rw-r--r-- | lib-src/update-game-score.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index d9218ff67b7..ad591cca87a 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; } |