Fix corrupted .sav files on w32 builds
[pspp-builds.git] / src / data / make-file.c
index 807adc50d9d112de7b47459f0a06a98a4786651f..2162741a78e416324d07578f49e5d75f5da4a95e 100644 (file)
@@ -185,7 +185,7 @@ replace_file_start (const char *file_name, const char *mode,
         }
 
       /* Create file by that name. */
-      fd = open (rf->tmp_name, O_WRONLY | O_CREAT | O_EXCL, permissions);
+      fd = open (rf->tmp_name, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, permissions);
       if (fd >= 0)
         break;
       if (errno != EEXIST)