diff options
author | Max Kellermann <max@musicpd.org> | 2019-02-05 21:33:56 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-02-05 21:36:51 +0100 |
commit | 096c23f27de97182b2902ce8aa51d8bd2b55f865 (patch) | |
tree | e66191db7d86efaad80aa68c8197284d353745f7 /src/unix | |
parent | 40bde1eac9822b0806c60fa9bb656993d564b586 (diff) |
unix/SignalHandlers: add RAII class
Diffstat (limited to 'src/unix')
-rw-r--r-- | src/unix/SignalHandlers.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/unix/SignalHandlers.hxx b/src/unix/SignalHandlers.hxx index d17c0504c..4808f97e5 100644 --- a/src/unix/SignalHandlers.hxx +++ b/src/unix/SignalHandlers.hxx @@ -28,4 +28,15 @@ SignalHandlersInit(EventLoop &loop); void SignalHandlersFinish() noexcept; +class ScopeSignalHandlersInit { +public: + ScopeSignalHandlersInit(EventLoop &loop) { + SignalHandlersInit(loop); + } + + ~ScopeSignalHandlersInit() noexcept { + SignalHandlersFinish(); + } +}; + #endif |