diff --git a/programs/fileio.c b/programs/fileio.c index 20868b9b8..48b6cb483 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -513,23 +513,17 @@ static FILE* FIO_openSrcFile(const char* srcFileName) 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 */ + ) { + DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n", + srcFileName); + return NULL; + } { FILE* const f = fopen(srcFileName, "rb"); if (f == NULL) diff --git a/programs/util.c b/programs/util.c index 5f97b1cde..54aca5b55 100644 --- a/programs/util.c +++ b/programs/util.c @@ -115,6 +115,8 @@ int UTIL_isSameFile(const char* file1, const char* file2) #endif } +#ifndef _MSC_VER +/* Using this to distinguish named pipes */ U32 UTIL_isFIFO(const char* infilename) { /* macro guards, as defined in : https://linux.die.net/man/2/lstat */ @@ -126,7 +128,7 @@ U32 UTIL_isFIFO(const char* infilename) (void)infilename; return 0; } - +#endif U32 UTIL_isLink(const char* infilename) { diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 66b7ae5d2..fe77be22e 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -992,25 +992,15 @@ int main(int argCount, const char* argv[]) if (!followLinks) { unsigned u; for (u=0, fileNamesNb=0; u 0) CLEAN_RETURN(1);