Async: Qualify system call wrappers with ::

This commit is contained in:
Tony Wasserka committed 2025-02-07 10:50:40 +01:00
1 parent 81e253b06b
commit e69e1200f5
2 files changed
+10 -10

No files matched your search

+3 -3
View File
@@ -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<std::chrono::nanoseconds> 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);
}
}
+7 -7
View File
@@ -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<sockaddr*>(&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<sockaddr*>(&Addr), &AddrSize);
NewFD = ::accept(ServerFD, reinterpret_cast<sockaddr*>(&Addr), &AddrSize);
} while (NewFD < 0 && (errno == EINTR || errno == EAGAIN));
if (NewFD < 0) {
return OnAccept(error::generic_errno, std::nullopt);