diff options
author | Max Kellermann <max@duempel.org> | 2015-03-03 17:03:21 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-03-03 17:14:30 +0100 |
commit | 40a587bbaff38bb0b60313c24b94e2ecd53b181c (patch) | |
tree | d72c9db82e0db482ebe054119460b506433e9d05 /src/system/EventFD.hxx | |
parent | 818d729d8b60a682e267ac408c710f5851389d79 (diff) | |
download | mpd-40a587bbaff38bb0b60313c24b94e2ecd53b181c.tar.gz mpd-40a587bbaff38bb0b60313c24b94e2ecd53b181c.tar.xz mpd-40a587bbaff38bb0b60313c24b94e2ecd53b181c.zip |
system/FileDescriptor: new wrapper class for a file descriptor
Diffstat (limited to 'src/system/EventFD.hxx')
-rw-r--r-- | src/system/EventFD.hxx | 9 |
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(); } /** |