mirror of
https://github.com/facebook/zstd.git
synced 2025-07-30 22:23:13 +03:00
do not add invocation of UTIL_isRegularFile()
This commit is contained in:
@ -581,6 +581,8 @@ FIO_openDstFile(FIO_ctx_t* fCtx, FIO_prefs_t* const prefs,
|
|||||||
const char* srcFileName, const char* dstFileName,
|
const char* srcFileName, const char* dstFileName,
|
||||||
const int mode)
|
const int mode)
|
||||||
{
|
{
|
||||||
|
int isDstRegFile;
|
||||||
|
|
||||||
if (prefs->testMode) return NULL; /* do not open file in test mode */
|
if (prefs->testMode) return NULL; /* do not open file in test mode */
|
||||||
|
|
||||||
assert(dstFileName != NULL);
|
assert(dstFileName != NULL);
|
||||||
@ -600,15 +602,16 @@ FIO_openDstFile(FIO_ctx_t* fCtx, FIO_prefs_t* const prefs,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isDstRegFile = UTIL_isRegularFile(dstFileName); /* invoke once */
|
||||||
if (prefs->sparseFileSupport == 1) {
|
if (prefs->sparseFileSupport == 1) {
|
||||||
if (!UTIL_isRegularFile(dstFileName)) {
|
if (!isDstRegFile) {
|
||||||
prefs->sparseFileSupport = 0;
|
prefs->sparseFileSupport = 0;
|
||||||
DISPLAYLEVEL(4, "Sparse File Support is disabled when output is not a file \n");
|
DISPLAYLEVEL(4, "Sparse File Support is disabled when output is not a file \n");
|
||||||
}
|
}
|
||||||
prefs->sparseFileSupport = ZSTD_SPARSE_DEFAULT;
|
prefs->sparseFileSupport = ZSTD_SPARSE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UTIL_isRegularFile(dstFileName)) {
|
if (isDstRegFile) {
|
||||||
/* Check if destination file already exists */
|
/* Check if destination file already exists */
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
/* this test does not work on Windows :
|
/* this test does not work on Windows :
|
||||||
|
Reference in New Issue
Block a user