first implementation supporting Process Substitution
This commit is contained in:
+4
-4
@@ -537,15 +537,13 @@ static int FIO_removeFile(const char* path)
|
||||
return remove(path);
|
||||
}
|
||||
|
||||
/** FIO_openSrcFile() :
|
||||
* condition : `srcFileName` must be non-NULL. `prefs` may be NULL.
|
||||
* @result : FILE* to `srcFileName`, or NULL if it fails */
|
||||
static FILE* FIO_openSrcFile(const FIO_prefs_t* const prefs, const char* srcFileName, stat_t* statbuf)
|
||||
{
|
||||
int allowBlockDevices = prefs != NULL ? prefs->allowBlockDevices : 0;
|
||||
assert(srcFileName != NULL);
|
||||
assert(statbuf != NULL);
|
||||
if (!strcmp (srcFileName, stdinmark)) {
|
||||
|
||||
if (!strcmp(srcFileName, stdinmark)) {
|
||||
DISPLAYLEVEL(4,"Using stdin for input \n");
|
||||
SET_BINARY_MODE(stdin);
|
||||
return stdin;
|
||||
@@ -557,8 +555,10 @@ static FILE* FIO_openSrcFile(const FIO_prefs_t* const prefs, const char* srcFile
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Accept regular files, FIFOs, and process substitution file descriptors */
|
||||
if (!UTIL_isRegularFileStat(statbuf)
|
||||
&& !UTIL_isFIFOStat(statbuf)
|
||||
&& !UTIL_isFileDescriptorPipe(srcFileName) /* Process substitution support */
|
||||
&& !(allowBlockDevices && UTIL_isBlockDevStat(statbuf))
|
||||
) {
|
||||
DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n",
|
||||
|
||||
Reference in New Issue
Block a user