Merge pull request #1850 from bimbashrestha/named_pipes
Gating named pipe support on windows
This commit is contained in:
commit
47034cd6c3
@ -173,8 +173,6 @@
|
|||||||
sh -e playTests.sh --test-large-data &&
|
sh -e playTests.sh --test-large-data &&
|
||||||
fullbench.exe -i1 &&
|
fullbench.exe -i1 &&
|
||||||
fullbench.exe -i1 -P0 &&
|
fullbench.exe -i1 -P0 &&
|
||||||
fuzzer_VS2008_%PLATFORM%_Release.exe %FUZZERTEST% &&
|
|
||||||
fuzzer_VS2010_%PLATFORM%_Release.exe %FUZZERTEST% &&
|
|
||||||
fuzzer_VS2012_%PLATFORM%_Release.exe %FUZZERTEST% &&
|
fuzzer_VS2012_%PLATFORM%_Release.exe %FUZZERTEST% &&
|
||||||
fuzzer_VS2013_%PLATFORM%_Release.exe %FUZZERTEST% &&
|
fuzzer_VS2013_%PLATFORM%_Release.exe %FUZZERTEST% &&
|
||||||
fuzzer_VS2015_%PLATFORM%_Release.exe %FUZZERTEST%
|
fuzzer_VS2015_%PLATFORM%_Release.exe %FUZZERTEST%
|
||||||
|
@ -525,7 +525,11 @@ static FILE* FIO_openSrcFile(const char* srcFileName)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
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",
|
DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n",
|
||||||
srcFileName);
|
srcFileName);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -126,6 +126,8 @@ int UTIL_isSameFile(const char* fName1, const char* fName2)
|
|||||||
#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 */
|
||||||
@ -137,7 +139,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)
|
||||||
{
|
{
|
||||||
|
@ -137,7 +137,9 @@ int UTIL_compareStr(const void *p1, const void *p2);
|
|||||||
int UTIL_isCompressedFile(const char* infilename, const char *extensionList[]);
|
int UTIL_isCompressedFile(const char* infilename, const char *extensionList[]);
|
||||||
const char* UTIL_getFileExtension(const char* infilename);
|
const char* UTIL_getFileExtension(const char* infilename);
|
||||||
|
|
||||||
|
#ifndef _MSC_VER
|
||||||
U32 UTIL_isFIFO(const char* infilename);
|
U32 UTIL_isFIFO(const char* infilename);
|
||||||
|
#endif
|
||||||
U32 UTIL_isLink(const char* infilename);
|
U32 UTIL_isLink(const char* infilename);
|
||||||
#define UTIL_FILESIZE_UNKNOWN ((U64)(-1))
|
#define UTIL_FILESIZE_UNKNOWN ((U64)(-1))
|
||||||
U64 UTIL_getFileSize(const char* infilename);
|
U64 UTIL_getFileSize(const char* infilename);
|
||||||
|
@ -1005,7 +1005,11 @@ 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]) && !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]);
|
DISPLAYLEVEL(2, "Warning : %s is a symbolic link, ignoring\n", filenameTable[u]);
|
||||||
} else {
|
} else {
|
||||||
filenameTable[fileNamesNb++] = filenameTable[u];
|
filenameTable[fileNamesNb++] = filenameTable[u];
|
||||||
|
@ -1170,6 +1170,8 @@ test -f dictionary
|
|||||||
rm -f tmp* dictionary
|
rm -f tmp* dictionary
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$isWindows" = false ] ; then
|
||||||
|
|
||||||
println "\n===> zstd fifo named pipe test "
|
println "\n===> zstd fifo named pipe test "
|
||||||
head -c 10 /dev/zero > tmp_original
|
head -c 10 /dev/zero > tmp_original
|
||||||
mkfifo named_pipe
|
mkfifo named_pipe
|
||||||
@ -1180,4 +1182,6 @@ $DIFF -s tmp_original tmp_decompressed
|
|||||||
rm -rf tmp*
|
rm -rf tmp*
|
||||||
rm -rf named_pipe
|
rm -rf named_pipe
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
rm -f tmp*
|
rm -f tmp*
|
||||||
|
Loading…
Reference in New Issue
Block a user