diff options
author | Brad King <brad.king@kitware.com> | 2021-08-20 15:23:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-08-20 15:23:20 (GMT) |
commit | 20fec1520458cdfb71bf1099cfc3648154d57d8f (patch) | |
tree | 2597bc6fb97dfbe86cdc41bd8efa7b0c97d2aebf /Source/cmSystemTools.cxx | |
parent | e2c06736e54d9160e49d5a67f5c10ca601ab31ed (diff) | |
download | CMake-20fec1520458cdfb71bf1099cfc3648154d57d8f.zip CMake-20fec1520458cdfb71bf1099cfc3648154d57d8f.tar.gz CMake-20fec1520458cdfb71bf1099cfc3648154d57d8f.tar.bz2 |
cmArchiveWrite: Check for construction errors on Open
Also update call sites to report the error.
Issue: #19666
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index f082ae8..54fe7a1 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1629,7 +1629,10 @@ bool cmSystemTools::CreateTar(const std::string& outFileName, cmArchiveWrite a(fout, compress, format.empty() ? "paxr" : format, compressionLevel); - a.Open(); + if (!a.Open()) { + cmSystemTools::Error(a.GetError()); + return false; + } a.SetMTime(mtime); a.SetVerbose(verbose); bool tarCreatedSuccessfully = true; |