[programs] Don’t try to chmod a dst file if it can’t be opened
Repairs an oversight in my last commit, thanks @Cyan4973
This commit is contained in:
+4
-2
@@ -564,9 +564,11 @@ static FILE* FIO_openDstFile(FIO_prefs_t* const prefs, const char* srcFileName,
|
|||||||
} }
|
} }
|
||||||
|
|
||||||
{ FILE* const f = fopen( dstFileName, "wb" );
|
{ FILE* const f = fopen( dstFileName, "wb" );
|
||||||
if (f == NULL)
|
if (f == NULL) {
|
||||||
DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno));
|
DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno));
|
||||||
chmod(dstFileName, 00600);
|
} else {
|
||||||
|
chmod(dstFileName, 00600);
|
||||||
|
}
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user