Add missing _unlink() calls for Windows

refs #5450
This commit is contained in:
Gunnar Beutner 2017-08-30 15:12:04 +02:00
parent cb49ac1264
commit a8cc0a601b
1 changed files with 8 additions and 0 deletions

View File

@ -208,6 +208,10 @@ void JsonRpcConnection::CertificateRequestResponseHandler(const Dictionary::Ptr&
cafp << ca;
cafp.close();
#ifdef _WIN32
_unlink(caPath.CStr());
#endif /* _WIN32 */
if (rename(tempCaPath.CStr(), caPath.CStr()) < 0) {
BOOST_THROW_EXCEPTION(posix_error()
<< boost::errinfo_api_function("rename")
@ -222,6 +226,10 @@ void JsonRpcConnection::CertificateRequestResponseHandler(const Dictionary::Ptr&
certfp << cert;
certfp.close();
#ifdef _WIN32
_unlink(certPath.CStr());
#endif /* _WIN32 */
if (rename(tempCertPath.CStr(), certPath.CStr()) < 0) {
BOOST_THROW_EXCEPTION(posix_error()
<< boost::errinfo_api_function("rename")