From f535ccf9bfd2c165ddddcda77b1fcda56d973f15 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 2 Aug 2024 16:25:09 +0200 Subject: [PATCH] net/UniqueSocketDescriptor: add UniqueFileDescriptor constructor --- src/net/UniqueSocketDescriptor.hxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/net/UniqueSocketDescriptor.hxx b/src/net/UniqueSocketDescriptor.hxx index 4c4a6466f..c74548736 100644 --- a/src/net/UniqueSocketDescriptor.hxx +++ b/src/net/UniqueSocketDescriptor.hxx @@ -26,7 +26,11 @@ public: #ifndef _WIN32 explicit UniqueSocketDescriptor(FileDescriptor _fd) noexcept :SocketDescriptor(_fd) {} + + explicit UniqueSocketDescriptor(UniqueFileDescriptor &&_fd) noexcept + :SocketDescriptor(_fd.Release()) {} #endif // !_WIN32 + explicit UniqueSocketDescriptor(int _fd) noexcept :SocketDescriptor(_fd) {}