From 603b69b4fdf9ae69a9a943d62b9431cea4eac991 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=83=A1=E7=8E=AE=E6=96=87?= Date: Sat, 16 Mar 2024 19:34:07 +0800 Subject: [PATCH] common/Journald: avoid future mis-use of copy MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit EntryEncoderBase have self-referencing pointers in it, and cannot be copied safely. Signed-off-by: 胡玮文 --- src/common/Journald.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/Journald.cc b/src/common/Journald.cc index 983a190b1a707..164b65834a649 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() { -- 2.39.5