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.
This commit is contained in:
Eli Zaretskii 2014-01-22 21:38:31 +02:00
parent e2a095b16f
commit 7a49c9d615
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2014-01-22 Eli Zaretskii <eliz@gnu.org>
* update-game-score.c (write_scores) [WINDOWSNT]: Use chmod
instead of fchmod.
2014-01-22 Paul Eggert <eggert@cs.ucla.edu>
Fix miscellaneous update-game-score bugs.

View file

@ -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;
}