From 258d798b3404114e1a369814655cdd1612403dde Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 6 Feb 2020 15:04:57 +0100 Subject: [PATCH] LibCore: Merge the CSyscallUtils namespace into Core --- Libraries/LibCore/EventLoop.cpp | 2 +- Libraries/LibCore/IODevice.cpp | 2 +- Libraries/LibCore/SyscallUtils.h | 4 ++-- Libraries/LibIPC/ServerConnection.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Libraries/LibCore/EventLoop.cpp b/Libraries/LibCore/EventLoop.cpp index aae6d33a5c5..70190411b9b 100644 --- a/Libraries/LibCore/EventLoop.cpp +++ b/Libraries/LibCore/EventLoop.cpp @@ -382,7 +382,7 @@ void EventLoop::wait_for_event(WaitMode mode) should_wait_forever = false; } - int marked_fd_count = CSyscallUtils::safe_syscall(select, max_fd + 1, &rfds, &wfds, nullptr, should_wait_forever ? nullptr : &timeout); + int marked_fd_count = Core::safe_syscall(select, max_fd + 1, &rfds, &wfds, nullptr, should_wait_forever ? nullptr : &timeout); if (FD_ISSET(s_wake_pipe_fds[0], &rfds)) { char buffer[32]; auto nread = read(s_wake_pipe_fds[0], buffer, sizeof(buffer)); diff --git a/Libraries/LibCore/IODevice.cpp b/Libraries/LibCore/IODevice.cpp index 7b8edc1f573..21a9140fcf8 100644 --- a/Libraries/LibCore/IODevice.cpp +++ b/Libraries/LibCore/IODevice.cpp @@ -110,7 +110,7 @@ bool IODevice::can_read_from_fd() const struct timeval timeout { 0, 0 }; - int rc = CSyscallUtils::safe_syscall(select, m_fd + 1, &rfds, nullptr, nullptr, &timeout); + int rc = Core::safe_syscall(select, m_fd + 1, &rfds, nullptr, nullptr, &timeout); if (rc < 0) { // NOTE: We don't set m_error here. perror("IODevice::can_read: select"); diff --git a/Libraries/LibCore/SyscallUtils.h b/Libraries/LibCore/SyscallUtils.h index 98563ae0735..3aff3bfe99b 100644 --- a/Libraries/LibCore/SyscallUtils.h +++ b/Libraries/LibCore/SyscallUtils.h @@ -32,7 +32,7 @@ #include #include -namespace CSyscallUtils { +namespace Core { template inline int safe_syscall(Syscall syscall, Args&&... args) @@ -41,7 +41,7 @@ inline int safe_syscall(Syscall syscall, Args&&... args) int sysret = syscall(forward(args)...); if (sysret == -1) { int saved_errno = errno; - dbg() << "CSafeSyscall: " << sysret << " (" << saved_errno << ": " << strerror(saved_errno) << ")"; + dbg() << "Core::safe_syscall: " << sysret << " (" << saved_errno << ": " << strerror(saved_errno) << ")"; if (errno == EINTR) continue; ASSERT_NOT_REACHED(); diff --git a/Libraries/LibIPC/ServerConnection.h b/Libraries/LibIPC/ServerConnection.h index e0aec5de6e0..05dcc0a8753 100644 --- a/Libraries/LibIPC/ServerConnection.h +++ b/Libraries/LibIPC/ServerConnection.h @@ -100,7 +100,7 @@ public: fd_set rfds; FD_ZERO(&rfds); FD_SET(m_connection->fd(), &rfds); - int rc = CSyscallUtils::safe_syscall(select, m_connection->fd() + 1, &rfds, nullptr, nullptr, nullptr); + int rc = Core::safe_syscall(select, m_connection->fd() + 1, &rfds, nullptr, nullptr, nullptr); if (rc < 0) { perror("select"); }