diff --git a/src/system/SignalFD.cxx b/src/system/SignalFD.cxx index 559c5a56b..33062a396 100644 --- a/src/system/SignalFD.cxx +++ b/src/system/SignalFD.cxx @@ -32,13 +32,6 @@ SignalFD::Create(const sigset_t &mask) FatalSystemError("signalfd() failed"); } -void -SignalFD::Close() -{ - if (fd.IsDefined()) - fd.Close(); -} - int SignalFD::Read() { diff --git a/src/system/SignalFD.hxx b/src/system/SignalFD.hxx index 8caa80dfe..bf3c40ed6 100644 --- a/src/system/SignalFD.hxx +++ b/src/system/SignalFD.hxx @@ -21,7 +21,7 @@ #define MPD_SIGNAL_FD_HXX #include "check.h" -#include "FileDescriptor.hxx" +#include "UniqueFileDescriptor.hxx" #include @@ -29,24 +29,18 @@ * A class that wraps signalfd(). */ class SignalFD { - FileDescriptor fd; + UniqueFileDescriptor fd; public: - SignalFD():fd(-1) {} - ~SignalFD() { - Close(); - } - - SignalFD(const SignalFD &other) = delete; - SignalFD &operator=(const SignalFD &other) = delete; - /** * Create the signalfd or update its mask. * * All errors are fatal. */ void Create(const sigset_t &mask); - void Close(); + void Close() { + fd.Close(); + } int Get() const { return fd.Get();