aboutsummaryrefslogtreecommitdiffstats
path: root/src/system/EventFD.hxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/system/EventFD.hxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/system/EventFD.hxx b/src/system/EventFD.hxx
index 654547078..616877f4a 100644
--- a/src/system/EventFD.hxx
+++ b/src/system/EventFD.hxx
@@ -21,6 +21,7 @@
#define MPD_EVENT_FD_HXX
#include "check.h"
+#include "FileDescriptor.hxx"
/**
* A class that wraps eventfd().
@@ -28,17 +29,19 @@
* Errors in the constructor are fatal.
*/
class EventFD {
- int fd;
+ FileDescriptor fd;
public:
EventFD();
- ~EventFD();
+ ~EventFD() {
+ fd.Close();
+ }
EventFD(const EventFD &other) = delete;
EventFD &operator=(const EventFD &other) = delete;
int Get() const {
- return fd;
+ return fd.Get();
}
/**