0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 12:12:15 +02:00

write_binary_atomic: support ConstBuffer

Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
James Yonan 2017-12-28 22:47:04 -07:00 committed by Antonio Quartulli
parent 6745799c93
commit 02e786bc92
No known key found for this signature in database
GPG Key ID: 07A53C580EF2CD74

View File

@ -47,7 +47,7 @@ namespace openvpn {
inline void write_binary_atomic(const std::string& fn,
const std::string& tmpdir,
const mode_t mode,
const Buffer& buf,
const ConstBuffer& buf,
RandomAPI& rng)
{
// generate temporary filename
@ -65,6 +65,15 @@ namespace openvpn {
OPENVPN_THROW(file_unix_error, "error moving '" << tfn << "' -> '" << fn << "' : " << strerror_str(eno));
}
}
inline void write_binary_atomic(const std::string& fn,
const std::string& tmpdir,
const mode_t mode,
const Buffer& buf,
RandomAPI& rng)
{
return write_binary_atomic(fn, tmpdir, mode, const_buffer_ref(buf), rng);
}
}
#endif