event/ServerSocket: use class UniqueSocketDescriptor in SupportsIPv6()
This commit is contained in:
parent
90565b1e36
commit
7a5f485cf8
@ -332,12 +332,7 @@ ServerSocket::AddPortIPv6(unsigned port) noexcept
|
|||||||
static bool
|
static bool
|
||||||
SupportsIPv6() noexcept
|
SupportsIPv6() noexcept
|
||||||
{
|
{
|
||||||
int fd = socket(AF_INET6, SOCK_STREAM, 0);
|
return UniqueSocketDescriptor{}.Create(AF_INET6, SOCK_STREAM, 0);
|
||||||
if (fd < 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
close(fd);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_IPV6 */
|
#endif /* HAVE_IPV6 */
|
||||||
|
Loading…
Reference in New Issue
Block a user