[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:
Mike Swanson
2019-06-09 01:52:45 -07:00
parent 3968160a91
commit af80f6dfac
+4 -2
View File
@@ -564,9 +564,11 @@ static FILE* FIO_openDstFile(FIO_prefs_t* const prefs, const char* srcFileName,
} }
{ FILE* const f = fopen( dstFileName, "wb" );
if (f == NULL)
if (f == NULL) {
DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno));
chmod(dstFileName, 00600);
} else {
chmod(dstFileName, 00600);
}
return f;
}
}