From dd18fe34a733a18d49dbff46ce41efcf4e1dc0f7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Aug 2018 11:53:45 +0200 Subject: [PATCH] system/SignalFD: throw exception on error --- src/event/SignalMonitor.hxx | 2 ++ src/system/SignalFD.cxx | 4 ++-- src/system/SignalFD.hxx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/event/SignalMonitor.hxx b/src/event/SignalMonitor.hxx index cdec98945..785293633 100644 --- a/src/event/SignalMonitor.hxx +++ b/src/event/SignalMonitor.hxx @@ -32,6 +32,8 @@ typedef BoundMethod SignalHandler; /** * Initialise the signal monitor subsystem. + * + * Throws on error. */ void SignalMonitorInit(EventLoop &loop); diff --git a/src/system/SignalFD.cxx b/src/system/SignalFD.cxx index 33062a396..d974b6630 100644 --- a/src/system/SignalFD.cxx +++ b/src/system/SignalFD.cxx @@ -20,7 +20,7 @@ #include "config.h" #ifdef USE_SIGNALFD #include "SignalFD.hxx" -#include "FatalError.hxx" +#include "Error.hxx" #include #include @@ -29,7 +29,7 @@ void SignalFD::Create(const sigset_t &mask) { if (!fd.CreateSignalFD(&mask)) - FatalSystemError("signalfd() failed"); + throw MakeErrno("signalfd() failed"); } int diff --git a/src/system/SignalFD.hxx b/src/system/SignalFD.hxx index bf3c40ed6..bc589fa41 100644 --- a/src/system/SignalFD.hxx +++ b/src/system/SignalFD.hxx @@ -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(); }