-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cpp
38 lines (28 loc) · 1.14 KB
/
Main.cpp
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
30
31
32
33
34
35
36
37
38
/// ********************************************************************************************************************
/// @author [email protected]
/// ********************************************************************************************************************
#include <iostream>
#include <csignal>
#include "Service/PiBalancer.h"
/// ********************************************************************************************************************
#define RESET "\e[0m"
#define RED "\e[0;31m"
#define GREEN "\e[0;32m"
#define CYAN "\e[0;36m"
/// ********************************************************************************************************************
static void signal_handler(int signum)
{
std::cerr << "Interrupt: " << signum << std::endl;
exit(signum);
}
int main(int argc, char* argv[])
{
std::signal(SIGINT, signal_handler);
std::signal(SIGSEGV, signal_handler);
std::signal(SIGTERM, signal_handler);
PiBalancer balancer_;
balancer_.Init();
balancer_.Term();
return 0;
}
/// EOF ****************************************************************************************************************