From 7a49c9d615d91efc1e65ef1d1367b1a5c076ac96 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 22 Jan 2014 21:38:31 +0200 Subject: 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. --- lib-src/update-game-score.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib-src/update-game-score.c') 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; } -- cgit v1.2.3