net/UniqueSocketDescriptor: use AdoptTag in the constructors that adopt ownership

This makes it a little bit harder to use the ownershop-adopting
constructors accidently.
This commit is contained in:
Max Kellermann
2025-01-23 16:36:54 +01:00
committed by Max Kellermann
parent 131263cbe3
commit 765a6a2f20
3 changed files with 8 additions and 7 deletions

View File

@@ -130,7 +130,7 @@ inline void
ServerSocket::OneServerSocket::Accept() noexcept
{
StaticSocketAddress peer_address;
UniqueSocketDescriptor peer_fd(event.GetSocket().AcceptNonBlock(peer_address));
UniqueSocketDescriptor peer_fd{AdoptTag{}, event.GetSocket().AcceptNonBlock(peer_address)};
if (!peer_fd.IsDefined()) {
const SocketErrorMessage msg;
FmtError(server_socket_domain,