diff options
author | Max Kellermann <max@musicpd.org> | 2018-08-22 15:31:19 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-08-22 15:40:45 +0200 |
commit | dd461400fb5c759dc32c063254cf3154f6fb5b9d (patch) | |
tree | ec0edb3f8bbdff37642b14a456351f4e64d1c486 | |
parent | b1390ec27fdbf35ab53a50eedf0fd63b8ea55e1b (diff) |
system/EPollFD: rename to EpollFD
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | src/event/PollGroup.hxx | 6 | ||||
-rw-r--r-- | src/event/PollGroupEpoll.hxx (renamed from src/event/PollGroupEPoll.hxx) | 18 | ||||
-rw-r--r-- | src/system/EpollFD.cxx (renamed from src/system/EPollFD.cxx) | 4 | ||||
-rw-r--r-- | src/system/EpollFD.hxx (renamed from src/system/EPollFD.hxx) | 10 |
5 files changed, 21 insertions, 21 deletions
diff --git a/Makefile.am b/Makefile.am index 49e92eddc..ad9aa5f31 100644 --- a/Makefile.am +++ b/Makefile.am @@ -619,7 +619,7 @@ libsystem_a_SOURCES = \ src/system/EventPipe.cxx src/system/EventPipe.hxx \ src/system/EventFD.cxx src/system/EventFD.hxx \ src/system/SignalFD.cxx src/system/SignalFD.hxx \ - src/system/EPollFD.cxx src/system/EPollFD.hxx \ + src/system/EpollFD.cxx src/system/EpollFD.hxx \ src/system/PeriodClock.hxx \ src/system/Clock.cxx src/system/Clock.hxx @@ -628,7 +628,7 @@ libsystem_a_SOURCES = \ libevent_a_SOURCES = \ src/event/WakeFD.hxx \ src/event/PollGroup.hxx \ - src/event/PollGroupEPoll.hxx \ + src/event/PollGroupEpoll.hxx \ src/event/PollGroupPoll.hxx src/event/PollGroupPoll.cxx \ src/event/PollGroupWinSelect.hxx src/event/PollGroupWinSelect.cxx \ src/event/PollResultGeneric.hxx \ diff --git a/src/event/PollGroup.hxx b/src/event/PollGroup.hxx index 764e0e737..73c752fbb 100644 --- a/src/event/PollGroup.hxx +++ b/src/event/PollGroup.hxx @@ -21,9 +21,9 @@ #define MPD_EVENT_POLLGROUP_HXX #ifdef USE_EPOLL -#include "PollGroupEPoll.hxx" -typedef PollResultEPoll PollResult; -typedef PollGroupEPoll PollGroup; +#include "PollGroupEpoll.hxx" +typedef PollResultEpoll PollResult; +typedef PollGroupEpoll PollGroup; #endif #ifdef USE_WINSELECT diff --git a/src/event/PollGroupEPoll.hxx b/src/event/PollGroupEpoll.hxx index f22ed3543..5fa1398c7 100644 --- a/src/event/PollGroupEPoll.hxx +++ b/src/event/PollGroupEpoll.hxx @@ -23,14 +23,14 @@ #include "check.h" #include "util/Compiler.h" -#include "system/EPollFD.hxx" +#include "system/EpollFD.hxx" #include <array> #include <algorithm> -class PollResultEPoll +class PollResultEpoll { - friend class PollGroupEPoll; + friend class PollGroupEpoll; std::array<epoll_event, 16> events; size_t n_events = 0; @@ -59,21 +59,21 @@ public: } }; -class PollGroupEPoll +class PollGroupEpoll { - EPollFD epoll; + EpollFD epoll; - PollGroupEPoll(PollGroupEPoll &) = delete; - PollGroupEPoll &operator=(PollGroupEPoll &) = delete; + PollGroupEpoll(PollGroupEpoll &) = delete; + PollGroupEpoll &operator=(PollGroupEpoll &) = delete; public: static constexpr unsigned READ = EPOLLIN; static constexpr unsigned WRITE = EPOLLOUT; static constexpr unsigned ERROR = EPOLLERR; static constexpr unsigned HANGUP = EPOLLHUP; - PollGroupEPoll() = default; + PollGroupEpoll() = default; - void ReadEvents(PollResultEPoll &result, int timeout_ms) noexcept { + void ReadEvents(PollResultEpoll &result, int timeout_ms) noexcept { int ret = epoll.Wait(result.events.data(), result.events.size(), timeout_ms); result.n_events = std::max(0, ret); diff --git a/src/system/EPollFD.cxx b/src/system/EpollFD.cxx index a119ab05e..bd05008b2 100644 --- a/src/system/EPollFD.cxx +++ b/src/system/EpollFD.cxx @@ -19,10 +19,10 @@ #include "config.h" #ifdef USE_EPOLL -#include "EPollFD.hxx" +#include "EpollFD.hxx" #include "Error.hxx" -EPollFD::EPollFD() +EpollFD::EpollFD() :fd(::epoll_create1(EPOLL_CLOEXEC)) { if (fd < 0) diff --git a/src/system/EPollFD.hxx b/src/system/EpollFD.hxx index caa5ac4ae..e355b3ca9 100644 --- a/src/system/EPollFD.hxx +++ b/src/system/EpollFD.hxx @@ -32,23 +32,23 @@ struct epoll_event; /** * A class that wraps Linux epoll. */ -class EPollFD { +class EpollFD { const int fd; public: /** * Throws on error. */ - EPollFD(); + EpollFD(); - ~EPollFD() noexcept { + ~EpollFD() noexcept { assert(fd >= 0); ::close(fd); } - EPollFD(const EPollFD &other) = delete; - EPollFD &operator=(const EPollFD &other) = delete; + EpollFD(const EpollFD &other) = delete; + EpollFD &operator=(const EpollFD &other) = delete; int Wait(epoll_event *events, int maxevents, int timeout) noexcept { return ::epoll_wait(fd, events, maxevents, timeout); |