diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-09-03 17:55:11 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-09-03 17:55:19 +0200 |
| commit | 4049ec5e8bdddbc48689521a26bf47236c2b490d (patch) | |
| tree | 6532546b5a1edcd77e8824d8cd854eac13e38c44 /src/wx | |
| parent | 5db3eda9c6f0d6b027263c519000997677253504 (diff) | |
Fix a few places where we should use dcp::File::open_error()
to get a more accurate error number on Windows.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/config_dialog.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 12e914742..da39c443a 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -473,7 +473,7 @@ CertificateChainEditor::export_certificate () } dcp::File f(path, "w"); if (!f) { - throw OpenFileError(path, errno, OpenFileError::WRITE); + throw OpenFileError(path, f.open_error(), OpenFileError::WRITE); } string const s = j->certificate(true); @@ -498,7 +498,7 @@ CertificateChainEditor::export_chain () } dcp::File f(path, "w"); if (!f) { - throw OpenFileError(path, errno, OpenFileError::WRITE); + throw OpenFileError(path, f.open_error(), OpenFileError::WRITE); } auto const s = _get()->chain(); @@ -619,7 +619,7 @@ CertificateChainEditor::export_private_key () } dcp::File f(path, "w"); if (!f) { - throw OpenFileError (path, errno, OpenFileError::WRITE); + throw OpenFileError(path, f.open_error(), OpenFileError::WRITE); } auto const s = _get()->key().get (); @@ -737,7 +737,7 @@ KeysPage::export_decryption_chain_and_key () boost::filesystem::path path(wx_to_std(d->GetPath())); dcp::File f(path, "w"); if (!f) { - throw OpenFileError(path, errno, OpenFileError::WRITE); + throw OpenFileError(path, f.open_error(), OpenFileError::WRITE); } auto const chain = Config::instance()->decryption_chain()->chain(); @@ -771,7 +771,7 @@ KeysPage::import_decryption_chain_and_key () dcp::File f(wx_to_std(d->GetPath()), "r"); if (!f) { - throw OpenFileError(f.path(), errno, OpenFileError::WRITE); + throw OpenFileError(f.path(), f.open_error(), OpenFileError::WRITE); } string current; @@ -836,7 +836,7 @@ KeysPage::export_decryption_certificate () } dcp::File f(path, "w"); if (!f) { - throw OpenFileError(path, errno, OpenFileError::WRITE); + throw OpenFileError(path, f.open_error(), OpenFileError::WRITE); } auto const s = Config::instance()->decryption_chain()->leaf().certificate (true); |
