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:
parent
6745799c93
commit
02e786bc92
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user