Skip to content

Commit

Permalink
improved facebook#232 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
inikep authored and terrelln committed Jan 27, 2017
1 parent 92a4dbf commit eb2d23a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions programs/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ static FILE* FIO_openSrcFile(const char* srcFileName)
f = stdin;
SET_BINARY_MODE(stdin);
} else {
if (!UTIL_doesFileExists(srcFileName)) {
DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n", srcFileName);
return NULL;
}
f = fopen(srcFileName, "rb");
if ( f==NULL ) DISPLAYLEVEL(1, "zstd: %s: %s \n", srcFileName, strerror(errno));
}
Expand Down Expand Up @@ -414,10 +418,6 @@ static int FIO_compressFilename_srcFile(cRess_t ress,
DISPLAYLEVEL(1, "zstd: %s is a directory -- ignored \n", srcFileName);
return 1;
}
if (!UTIL_doesFileExists(srcFileName)) {
DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n", srcFileName);
return 1;
}

ress.srcFile = FIO_openSrcFile(srcFileName);
if (!ress.srcFile) return 1; /* srcFile could not be opened */
Expand Down Expand Up @@ -777,10 +777,6 @@ static int FIO_decompressSrcFile(dRess_t ress, const char* dstFileName, const ch
DISPLAYLEVEL(1, "zstd: %s is a directory -- ignored \n", srcFileName);
return 1;
}
if (!UTIL_doesFileExists(srcFileName)) {
DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n", srcFileName);
return 1;
}

srcFile = FIO_openSrcFile(srcFileName);
if (srcFile==0) return 1;
Expand Down

0 comments on commit eb2d23a

Please sign in to comment.