From: Topher Lubaway Date: Mon, 11 Jun 2018 22:26:35 +0000 (-0700) Subject: Only check for tty in non-windows environments X-Git-Tag: v1.3.5~3^2~14^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=881defaeb39e20ad2b11ff1c07237e58c644739e;p=thirdparty%2Fzstd.git Only check for tty in non-windows environments unistd.h is for unix standard tools. There does not appear to be a simple isatty for windows this we only run the logic and header include in non-windows environments --- diff --git a/programs/fileio.c b/programs/fileio.c index 0cfc968fb..df68b235b 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -27,7 +27,6 @@ #include "platform.h" /* Large Files support, SET_BINARY_MODE */ #include "util.h" /* UTIL_getFileSize, UTIL_isRegularFile */ #include /* fprintf, fopen, fread, _fileno, stdin, stdout */ -#include /* isatty */ #include /* malloc, free */ #include /* strcmp, strlen */ #include /* errno */ @@ -35,6 +34,8 @@ #if defined (_MSC_VER) # include # include +#else +# include /* isatty */ #endif #include "mem.h" @@ -2031,10 +2032,14 @@ static int FIO_listFile(fileInfo_t* total, const char* inFileName, int displayLe } int FIO_listMultipleFiles(unsigned numFiles, const char** filenameTable, int displayLevel){ + // isatty comes from the header unistd.h + // windows has no equilivant + #if !defined(_MSC_VER) if (!isatty(0)) { DISPLAYOUT("zstd: --list does not support reading from standard input\n"); return 1; } + #endif if (numFiles == 0) { DISPLAYOUT("No files given\n");