diff --git a/common/wivrn_sockets.cpp b/common/wivrn_sockets.cpp index 7a0be218..4d4c7c81 100644 --- a/common/wivrn_sockets.cpp +++ b/common/wivrn_sockets.cpp @@ -69,10 +69,9 @@ wivrn::fd_base::~fd_base() wivrn::UDP::UDP() { fd = socket(AF_INET6, SOCK_DGRAM, 0); - fcntl(fd, F_SETFD, FD_CLOEXEC); - if (fd < 0) throw std::system_error{errno, std::generic_category()}; + fcntl(fd, F_SETFD, FD_CLOEXEC); } wivrn::UDP::UDP(int fd) @@ -177,10 +176,9 @@ wivrn::TCP::TCP(int fd) wivrn::TCP::TCP(in6_addr address, int port) { fd = socket(AF_INET6, SOCK_STREAM, 0); - fcntl(fd, F_SETFD, FD_CLOEXEC); - if (fd < 0) throw std::system_error{errno, std::generic_category()}; + fcntl(fd, F_SETFD, FD_CLOEXEC); sockaddr_in6 sa; sa.sin6_family = AF_INET6; @@ -199,10 +197,9 @@ wivrn::TCP::TCP(in6_addr address, int port) wivrn::TCP::TCP(in_addr address, int port) { fd = socket(AF_INET, SOCK_STREAM, 0); - fcntl(fd, F_SETFD, FD_CLOEXEC); - if (fd < 0) throw std::system_error{errno, std::generic_category()}; + fcntl(fd, F_SETFD, FD_CLOEXEC); sockaddr_in sa; sa.sin_family = AF_INET;