mirror of
https://github.com/facebook/zstd.git
synced 2025-07-30 22:23:13 +03:00
Cleaning up gate and adding comment to flag
This commit is contained in:
@ -513,23 +513,17 @@ 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)) {
|
|
||||||
DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n",
|
|
||||||
srcFileName);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (!UTIL_isRegularFile(srcFileName)
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
&& !UTIL_isFIFO(srcFileName)
|
||||||
#endif /* _MSC_VER */
|
#endif /* _MSC_VER */
|
||||||
|
) {
|
||||||
|
DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n",
|
||||||
|
srcFileName);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
{ FILE* const f = fopen(srcFileName, "rb");
|
{ FILE* const f = fopen(srcFileName, "rb");
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
|
@ -115,6 +115,8 @@ int UTIL_isSameFile(const char* file1, const char* file2)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
/* Using this to distinguish named pipes */
|
||||||
U32 UTIL_isFIFO(const char* infilename)
|
U32 UTIL_isFIFO(const char* infilename)
|
||||||
{
|
{
|
||||||
/* macro guards, as defined in : https://linux.die.net/man/2/lstat */
|
/* macro guards, as defined in : https://linux.die.net/man/2/lstat */
|
||||||
@ -126,7 +128,7 @@ U32 UTIL_isFIFO(const char* infilename)
|
|||||||
(void)infilename;
|
(void)infilename;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
U32 UTIL_isLink(const char* infilename)
|
U32 UTIL_isLink(const char* infilename)
|
||||||
{
|
{
|
||||||
|
@ -992,25 +992,15 @@ 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++) {
|
||||||
|
if (UTIL_isLink(filenameTable[u])
|
||||||
#ifdef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
|
&& !UTIL_isFIFO(filenameTable[u])
|
||||||
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])) {
|
|
||||||
DISPLAYLEVEL(2, "Warning : %s is a symbolic link, ignoring\n", filenameTable[u]);
|
|
||||||
} else {
|
|
||||||
filenameTable[fileNamesNb++] = filenameTable[u];
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* _MSC_VER */
|
#endif /* _MSC_VER */
|
||||||
|
) {
|
||||||
|
DISPLAYLEVEL(2, "Warning : %s is a symbolic link, ignoring\n", filenameTable[u]);
|
||||||
|
} else {
|
||||||
|
filenameTable[fileNamesNb++] = filenameTable[u];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (fileNamesNb == 0 && filenameIdx > 0)
|
if (fileNamesNb == 0 && filenameIdx > 0)
|
||||||
CLEAN_RETURN(1);
|
CLEAN_RETURN(1);
|
||||||
|
Reference in New Issue
Block a user