Skip to content

Commit

Permalink
[programs] Don’t try to chmod a dst file if it can’t be opened
Browse files Browse the repository at this point in the history
Repairs an oversight in my last commit, thanks @Cyan4973
  • Loading branch information
chungy committed Jun 9, 2019
1 parent 3968160 commit af80f6d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions programs/fileio.c
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit af80f6d

Please sign in to comment.