From 3bbff693cb64dc3ae050ef3ade2cfd0082929264 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 4c4a6466..c7454873 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) {}