summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackArchiveGenerator.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2019-04-04 18:03:21 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2020-03-31 15:08:32 (GMT)
commitb9c17de023ea50e7be358519141971aa136858ca (patch)
tree348ecb16aa8ac6193f0a837b3255d4c933b77c68 /Source/CPack/cmCPackArchiveGenerator.cxx
parent206a65c3b8156acc0677a9adb2ab149021f25c20 (diff)
downloadCMake-b9c17de023ea50e7be358519141971aa136858ca.zip
CMake-b9c17de023ea50e7be358519141971aa136858ca.tar.gz
CMake-b9c17de023ea50e7be358519141971aa136858ca.tar.bz2
cmArchiveWrite: split out opening the file
This allows options to be set before the "header" phase of libarchive's API.
Diffstat (limited to 'Source/CPack/cmCPackArchiveGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 43f2946..f0a6965 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -154,6 +154,13 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
} \
cmArchiveWrite archive(gf, this->Compress, this->ArchiveFormat); \
do { \
+ if (!archive.Open()) { \
+ cmCPackLogger(cmCPackLog::LOG_ERROR, \
+ "Problem to open archive <" \
+ << (filename) << ">, ERROR = " << (archive).GetError() \
+ << std::endl); \
+ return 0; \
+ } \
if (!(archive)) { \
cmCPackLogger(cmCPackLog::LOG_ERROR, \
"Problem to create archive <" \