From: 胡玮文 Date: Sat, 16 Mar 2024 11:34:07 +0000 (+0800) Subject: common/Journald: avoid future mis-use of copy X-Git-Tag: v20.0.0~1992^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=603b69b4fdf9ae69a9a943d62b9431cea4eac991;p=ceph.git common/Journald: avoid future mis-use of copy EntryEncoderBase have self-referencing pointers in it, and cannot be copied safely. Signed-off-by: 胡玮文 --- diff --git a/src/common/Journald.cc b/src/common/Journald.cc index 983a190b1a70..164b65834a64 100644 --- a/src/common/Journald.cc +++ b/src/common/Journald.cc @@ -87,6 +87,8 @@ class EntryEncoderBase { m_msg_vec[0].iov_len = static_segment.size(); } + EntryEncoderBase(const EntryEncoderBase&) = delete; // we have self-referencing pointers + constexpr struct iovec *iovec() { return this->m_msg_vec; } constexpr std::size_t iovec_len() {