diff --git a/Source/Common/Async.h b/Source/Common/Async.h index dba6607c4..1dbd9d5a4 100644 --- a/Source/Common/Async.h +++ b/Source/Common/Async.h @@ -88,7 +88,7 @@ public: ERROR_AND_DIE_FMT("Tried to use stop_async without calling enable_async_stop during setup"); } // Wake up run() thread by closing this pipe endpoint - close(AsyncStopRequest[1]); + ::close(AsyncStopRequest[1]); } error run(std::optional Timeout = std::nullopt) { @@ -98,7 +98,7 @@ public: timespec ts = to_timespec(Timeout.value_or(std::chrono::nanoseconds {0})); while (true) { - int Result = ppoll(PollFDs.data(), PollFDs.size(), Timeout ? &ts : nullptr, nullptr); + int Result = ::ppoll(PollFDs.data(), PollFDs.size(), Timeout ? &ts : nullptr, nullptr); if (Result < 0) { if (errno == EINTR || errno == EAGAIN) { @@ -387,7 +387,7 @@ struct posix_descriptor { ~posix_descriptor() { if (FD != -1) { - close(FD); + ::close(FD); } } diff --git a/Source/Common/AsyncNet.h b/Source/Common/AsyncNet.h index 99a1e366e..071951d85 100644 --- a/Source/Common/AsyncNet.h +++ b/Source/Common/AsyncNet.h @@ -106,7 +106,7 @@ struct tcp_socket { ssize_t Ret; do { - Ret = sendmsg(FD, &msg, 0); + Ret = ::sendmsg(FD, &msg, 0); } while (Ret < 0 && (errno == EINTR || errno == EAGAIN)); if (Ret < 0) { ec = error::generic_errno; @@ -148,7 +148,7 @@ private: ssize_t BytesRead; do { - BytesRead = recvmsg(FD, &msg, 0); + BytesRead = ::recvmsg(FD, &msg, 0); } while (BytesRead < 0 && (errno == EINTR || errno == EAGAIN)); if (BytesRead < 0) { if (errno != 0) { @@ -192,7 +192,7 @@ struct tcp_acceptor { ~tcp_acceptor() { if (FD != -1) { - close(FD); + ::close(FD); } } @@ -229,13 +229,13 @@ struct tcp_acceptor { // Bind the socket to the path int Result = bind(FD, reinterpret_cast(&addr), sizeof(addr.sun_family) + (NameEnd - addr.sun_path)); if (Result == -1) { - close(FD); + ::close(FD); return {}; } - Result = listen(FD, MaxPending); + Result = ::listen(FD, MaxPending); if (Result == -1) { - close(FD); + ::close(FD); return {}; } @@ -258,7 +258,7 @@ struct tcp_acceptor { socklen_t AddrSize {}; int NewFD; do { - NewFD = accept(ServerFD, reinterpret_cast(&Addr), &AddrSize); + NewFD = ::accept(ServerFD, reinterpret_cast(&Addr), &AddrSize); } while (NewFD < 0 && (errno == EINTR || errno == EAGAIN)); if (NewFD < 0) { return OnAccept(error::generic_errno, std::nullopt);