From c2f23d92dcc414cfabf65a74975f075ccc1ea31f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 29 Jan 2018 21:48:39 +0100 Subject: [PATCH] system/EPollFD: add "noexcept" --- src/system/EPollFD.cxx | 2 +- src/system/EPollFD.hxx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/system/EPollFD.cxx b/src/system/EPollFD.cxx index 93c957f4d..d22d3836b 100644 --- a/src/system/EPollFD.cxx +++ b/src/system/EPollFD.cxx @@ -30,7 +30,7 @@ #define EPOLL_CLOEXEC O_CLOEXEC static inline int -epoll_create1(int flags) +epoll_create1(int flags) noexcept { return syscall(__NR_epoll_create1, flags); } diff --git a/src/system/EPollFD.hxx b/src/system/EPollFD.hxx index 2c214f413..39dc5c6f5 100644 --- a/src/system/EPollFD.hxx +++ b/src/system/EPollFD.hxx @@ -40,7 +40,7 @@ class EPollFD { public: EPollFD(); - ~EPollFD() { + ~EPollFD() noexcept { assert(fd >= 0); ::close(fd); @@ -49,15 +49,15 @@ public: EPollFD(const EPollFD &other) = delete; EPollFD &operator=(const EPollFD &other) = delete; - int Wait(epoll_event *events, int maxevents, int timeout) { + int Wait(epoll_event *events, int maxevents, int timeout) noexcept { return ::epoll_wait(fd, events, maxevents, timeout); } - bool Control(int op, int _fd, epoll_event *event) { + bool Control(int op, int _fd, epoll_event *event) noexcept { return ::epoll_ctl(fd, op, _fd, event) >= 0; } - bool Add(int _fd, uint32_t events, void *ptr) { + bool Add(int _fd, uint32_t events, void *ptr) noexcept { epoll_event e; e.events = events; e.data.ptr = ptr; @@ -65,7 +65,7 @@ public: return Control(EPOLL_CTL_ADD, _fd, &e); } - bool Modify(int _fd, uint32_t events, void *ptr) { + bool Modify(int _fd, uint32_t events, void *ptr) noexcept { epoll_event e; e.events = events; e.data.ptr = ptr; @@ -73,7 +73,7 @@ public: return Control(EPOLL_CTL_MOD, _fd, &e); } - bool Remove(int _fd) { + bool Remove(int _fd) noexcept { return Control(EPOLL_CTL_DEL, _fd, nullptr); } };