summaryrefslogtreecommitdiff
path: root/src/common/Utilities/SignalHandler.h
blob: 2fcccac70303406c561a0857f7bd1d7688195bf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (C) 2016+     AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
 * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
 * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
 */

#ifndef __SIGNAL_HANDLER_H__
#define __SIGNAL_HANDLER_H__

#include <ace/Event_Handler.h>

namespace acore
{

    /// Handle termination signals
    class SignalHandler : public ACE_Event_Handler
    {
    public:
        int handle_signal(int SigNum, siginfo_t* = nullptr, ucontext_t* = nullptr) override
        {
            HandleSignal(SigNum);
            return 0;
        }
        virtual void HandleSignal(int /*SigNum*/) { };
    };

}

#endif /* __SIGNAL_HANDLER_H__ */