]> wimlib.net Git - wimlib/blobdiff - src/write.c
Win32: Use O_BINARY to stop Windows from messing with our data
[wimlib] / src / write.c
index 1dd35e52c047f14316ac223ee529ce39ba3def3c..b5954e342d81bdd7b2370e261da58f982b92fc45 100644 (file)
@@ -1838,7 +1838,7 @@ lock_wim(WIMStruct *w, filedes_t fd)
 static int
 open_wim_writable(WIMStruct *w, const tchar *path, int open_flags)
 {
-       w->out_fd = topen(path, open_flags, 0644);
+       w->out_fd = topen(path, open_flags | O_BINARY, 0644);
        if (w->out_fd == INVALID_FILEDES) {
                ERROR_WITH_ERRNO("Failed to open `%"TS"' for writing", path);
                return WIMLIB_ERR_OPEN;