mirror of
https://github.com/facebook/zstd.git
synced 2025-08-08 17:22:10 +03:00
Gating named file support on windows
This commit is contained in:
@@ -513,12 +513,24 @@ static FILE* FIO_openSrcFile(const char* srcFileName)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
|
if (!UTIL_isRegularFile(srcFileName)) {
|
||||||
|
DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n",
|
||||||
|
srcFileName);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
if (!UTIL_isRegularFile(srcFileName) && !UTIL_isFIFO(srcFileName)) {
|
if (!UTIL_isRegularFile(srcFileName) && !UTIL_isFIFO(srcFileName)) {
|
||||||
DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n",
|
DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n",
|
||||||
srcFileName);
|
srcFileName);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* _MSC_VER */
|
||||||
|
|
||||||
{ FILE* const f = fopen(srcFileName, "rb");
|
{ FILE* const f = fopen(srcFileName, "rb");
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
DISPLAYLEVEL(1, "zstd: %s: %s \n", srcFileName, strerror(errno));
|
DISPLAYLEVEL(1, "zstd: %s: %s \n", srcFileName, strerror(errno));
|
||||||
|
@@ -992,11 +992,25 @@ int main(int argCount, const char* argv[])
|
|||||||
if (!followLinks) {
|
if (!followLinks) {
|
||||||
unsigned u;
|
unsigned u;
|
||||||
for (u=0, fileNamesNb=0; u<filenameIdx; u++) {
|
for (u=0, fileNamesNb=0; u<filenameIdx; u++) {
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
|
if (UTIL_isLink(filenameTable[u])) {
|
||||||
|
DISPLAYLEVEL(2, "Warning : %s is a symbolic link, ignoring\n", filenameTable[u]);
|
||||||
|
} else {
|
||||||
|
filenameTable[fileNamesNb++] = filenameTable[u];
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
if (UTIL_isLink(filenameTable[u]) && !UTIL_isFIFO(filenameTable[u])) {
|
if (UTIL_isLink(filenameTable[u]) && !UTIL_isFIFO(filenameTable[u])) {
|
||||||
DISPLAYLEVEL(2, "Warning : %s is a symbolic link, ignoring\n", filenameTable[u]);
|
DISPLAYLEVEL(2, "Warning : %s is a symbolic link, ignoring\n", filenameTable[u]);
|
||||||
} else {
|
} else {
|
||||||
filenameTable[fileNamesNb++] = filenameTable[u];
|
filenameTable[fileNamesNb++] = filenameTable[u];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* _MSC_VER */
|
||||||
|
|
||||||
}
|
}
|
||||||
if (fileNamesNb == 0 && filenameIdx > 0)
|
if (fileNamesNb == 0 && filenameIdx > 0)
|
||||||
CLEAN_RETURN(1);
|
CLEAN_RETURN(1);
|
||||||
|
@@ -1080,6 +1080,8 @@ test -f dictionary
|
|||||||
rm -f tmp* dictionary
|
rm -f tmp* dictionary
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$isWindows" = false ] ; then
|
||||||
|
|
||||||
println "\n===> zstd fifo named pipe test "
|
println "\n===> zstd fifo named pipe test "
|
||||||
head -c 10 /dev/zero > tmp_original
|
head -c 10 /dev/zero > tmp_original
|
||||||
mkfifo named_pipe
|
mkfifo named_pipe
|
||||||
@@ -1090,4 +1092,6 @@ $DIFF -s tmp_original tmp_decompressed
|
|||||||
rm -rf tmp*
|
rm -rf tmp*
|
||||||
rm -rf named_pipe
|
rm -rf named_pipe
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
rm -f tmp*
|
rm -f tmp*
|
||||||
|
Reference in New Issue
Block a user