From 17eae74c1c186a58c994451eea4b64b453ca5357 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 11 Jan 2021 17:38:01 +0100 Subject: [PATCH] system/EventFD: Get() returns FileDescriptor --- src/event/WakeFD.hxx | 4 ++++ src/system/EventFD.hxx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/event/WakeFD.hxx b/src/event/WakeFD.hxx index e26bcaee2..4ed1a23b0 100644 --- a/src/event/WakeFD.hxx +++ b/src/event/WakeFD.hxx @@ -38,7 +38,11 @@ class WakeFD { public: SocketDescriptor GetSocket() const noexcept { +#ifdef USE_EVENTFD + return SocketDescriptor::FromFileDescriptor(fd.Get()); +#else return SocketDescriptor(fd.Get()); +#endif } bool Read() noexcept { diff --git a/src/system/EventFD.hxx b/src/system/EventFD.hxx index 337947472..e7565c890 100644 --- a/src/system/EventFD.hxx +++ b/src/system/EventFD.hxx @@ -44,8 +44,8 @@ public: */ EventFD(); - int Get() const noexcept { - return fd.Get(); + FileDescriptor Get() const noexcept { + return fd; } /**