From af80f6dfacafcc2c916ecd57731107221e1f9986 Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Sun, 9 Jun 2019 01:52:45 -0700 Subject: [PATCH] =?utf8?q?[programs]=20Don=E2=80=99t=20try=20to=20chmod=20?= =?utf8?q?a=20dst=20file=20if=20it=20can=E2=80=99t=20be=20opened?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Repairs an oversight in my last commit, thanks @Cyan4973 --- programs/fileio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/programs/fileio.c b/programs/fileio.c index 12e1537e6..fba711575 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -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; } } -- 2.47.2