Commit 83335513 authored by Max Kellermann's avatar Max Kellermann

system/SignalFD: use class UniqueFileDescriptor

parent 292d7948
......@@ -32,13 +32,6 @@ SignalFD::Create(const sigset_t &mask)
FatalSystemError("signalfd() failed");
}
void
SignalFD::Close()
{
if (fd.IsDefined())
fd.Close();
}
int
SignalFD::Read()
{
......
......@@ -21,7 +21,7 @@
#define MPD_SIGNAL_FD_HXX
#include "check.h"
#include "FileDescriptor.hxx"
#include "UniqueFileDescriptor.hxx"
#include <signal.h>
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment