chunk: On Windows, use binary mode in chunk_write()

This commit is contained in:
Martin Willi
2014-06-04 15:53:10 +02:00
parent fc50731376
commit 1309cb7b1a
+8 -1
View File
@@ -221,7 +221,14 @@ bool chunk_write(chunk_t chunk, char *path, mode_t mask, bool force)
return FALSE;
}
oldmask = umask(mask);
fd = fopen(path, "w");
fd = fopen(path,
#ifdef WIN32
"wb"
#else
"w"
#endif
);
if (fd)
{
if (fwrite(chunk.ptr, sizeof(u_char), chunk.len, fd) == chunk.len)