net/UniqueSocketDescriptor: add UniqueFileDescriptor constructor

This commit is contained in:
Max Kellermann 2024-08-02 16:25:09 +02:00 committed by Max Kellermann
parent 75eb2c257c
commit f535ccf9bf
1 changed files with 4 additions and 0 deletions

View File

@ -26,7 +26,11 @@ public:
#ifndef _WIN32 #ifndef _WIN32
explicit UniqueSocketDescriptor(FileDescriptor _fd) noexcept explicit UniqueSocketDescriptor(FileDescriptor _fd) noexcept
:SocketDescriptor(_fd) {} :SocketDescriptor(_fd) {}
explicit UniqueSocketDescriptor(UniqueFileDescriptor &&_fd) noexcept
:SocketDescriptor(_fd.Release()) {}
#endif // !_WIN32 #endif // !_WIN32
explicit UniqueSocketDescriptor(int _fd) noexcept explicit UniqueSocketDescriptor(int _fd) noexcept
:SocketDescriptor(_fd) {} :SocketDescriptor(_fd) {}