]> code.delx.au - gnu-emacs/commitdiff
Fix MS-Windows build in lib-src broken by last commit.
authorEli Zaretskii <eliz@gnu.org>
Wed, 22 Jan 2014 19:38:31 +0000 (21:38 +0200)
committerEli Zaretskii <eliz@gnu.org>
Wed, 22 Jan 2014 19:38:31 +0000 (21:38 +0200)
 lib-src/update-game-score.c (write_scores) [WINDOWSNT]: Use chmod
 instead of fchmod.

lib-src/ChangeLog
lib-src/update-game-score.c

index 0d06a926bae55e9e2195aab82dbf5ff244196fdb..6f4f3cd86e3e68045a4932767ba9439e50a15a05 100644 (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.
index d9218ff67b784cc21940b9daddd9e66431743422..ad591cca87a025aa1c12d73403f2333e1dcf0973 100644 (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;
 }