From: Bimba Shrestha Date: Fri, 25 Oct 2019 21:06:50 +0000 (-0700) Subject: Cleaning up gate and adding comment to flag X-Git-Tag: v1.4.4~1^2~3^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b52d878b27b320a6398048db094794bac15b83a;p=thirdparty%2Fzstd.git Cleaning up gate and adding comment to flag --- diff --git a/programs/fileio.c b/programs/fileio.c index 20868b9b8..48b6cb483 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -513,24 +513,18 @@ 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)) { + 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; } -#endif /* _MSC_VER */ - { FILE* const f = fopen(srcFileName, "rb"); if (f == NULL) DISPLAYLEVEL(1, "zstd: %s: %s \n", srcFileName, strerror(errno)); 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);