system/SignalFD: throw exception on error
This commit is contained in:
parent
5b09504a71
commit
dd18fe34a7
@ -32,6 +32,8 @@ typedef BoundMethod<void()> SignalHandler;
|
||||
|
||||
/**
|
||||
* Initialise the signal monitor subsystem.
|
||||
*
|
||||
* Throws on error.
|
||||
*/
|
||||
void
|
||||
SignalMonitorInit(EventLoop &loop);
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "config.h"
|
||||
#ifdef USE_SIGNALFD
|
||||
#include "SignalFD.hxx"
|
||||
#include "FatalError.hxx"
|
||||
#include "Error.hxx"
|
||||
|
||||
#include <assert.h>
|
||||
#include <sys/signalfd.h>
|
||||
@ -29,7 +29,7 @@ void
|
||||
SignalFD::Create(const sigset_t &mask)
|
||||
{
|
||||
if (!fd.CreateSignalFD(&mask))
|
||||
FatalSystemError("signalfd() failed");
|
||||
throw MakeErrno("signalfd() failed");
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -35,9 +35,10 @@ public:
|
||||
/**
|
||||
* Create the signalfd or update its mask.
|
||||
*
|
||||
* All errors are fatal.
|
||||
* Throws on error.
|
||||
*/
|
||||
void Create(const sigset_t &mask);
|
||||
|
||||
void Close() {
|
||||
fd.Close();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user