]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Cleaning up gate and adding comment to flag
authorBimba Shrestha <bimbashrestha@fb.com>
Fri, 25 Oct 2019 21:06:50 +0000 (14:06 -0700)
committerBimba Shrestha <bimbashrestha@fb.com>
Fri, 25 Oct 2019 21:06:50 +0000 (14:06 -0700)
programs/fileio.c
programs/util.c
programs/zstdcli.c

index 20868b9b8e8f354c9ab66817647b0ab0db0b7f7e..48b6cb48386433e16c3fdba56367c838a6ab13e3 100644 (file)
@@ -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));
index 5f97b1cde1d4e7d294493d25a34f0194f97173e1..54aca5b554b335bf03cbbb1567f1b2167c1aa369 100644 (file)
@@ -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)
 {
index 66b7ae5d2e336a5afb38cafe9039e367431ecc1c..fe77be22e48c1ff450bb9ba8d61e30655dfda92c 100644 (file)
@@ -992,25 +992,15 @@ int main(int argCount, const char* argv[])
     if (!followLinks) {
         unsigned 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])
+#ifndef _MSC_VER
+                && !UTIL_isFIFO(filenameTable[u])
+#endif /* _MSC_VER */
+            ) {
                 DISPLAYLEVEL(2, "Warning : %s is a symbolic link, ignoring\n", filenameTable[u]);
             } else {
                 filenameTable[fileNamesNb++] = filenameTable[u];
             }
-
-#endif /* _MSC_VER */
-
         }
         if (fileNamesNb == 0 && filenameIdx > 0)
             CLEAN_RETURN(1);