Attempt to Fix Windows Build Error
This commit is contained in:
+6
-1
@@ -702,14 +702,19 @@ FIO_openDstFile(FIO_ctx_t* fCtx, FIO_prefs_t* const prefs,
|
|||||||
/* Windows requires opening the file as a "binary" file to avoid
|
/* Windows requires opening the file as a "binary" file to avoid
|
||||||
* mangling. This macro doesn't exist on unix. */
|
* mangling. This macro doesn't exist on unix. */
|
||||||
const int openflags = O_WRONLY|O_CREAT|O_TRUNC|O_BINARY;
|
const int openflags = O_WRONLY|O_CREAT|O_TRUNC|O_BINARY;
|
||||||
|
const int fd = _open(dstFileName, openflags, mode);
|
||||||
|
FILE* f = NULL;
|
||||||
|
if (fd != -1) {
|
||||||
|
f = _fdopen(fd, "wb");
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
const int openflags = O_WRONLY|O_CREAT|O_TRUNC;
|
const int openflags = O_WRONLY|O_CREAT|O_TRUNC;
|
||||||
#endif
|
|
||||||
const int fd = open(dstFileName, openflags, mode);
|
const int fd = open(dstFileName, openflags, mode);
|
||||||
FILE* f = NULL;
|
FILE* f = NULL;
|
||||||
if (fd != -1) {
|
if (fd != -1) {
|
||||||
f = fdopen(fd, "wb");
|
f = fdopen(fd, "wb");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno));
|
DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user