#include #include #include #include #include #include #include #include #include #include #include #include #include "DisplayCenter.h" #define BUF_LEN_FOR_PID 64 static void sigHandler(int sig) { // if (sig == SIGINT || sig == SIGTERM) // remove(MY_PID_FILE); printf("exit now for signal: %d\n", sig); _exit(0); } int main() { /* Ctrl + C */ if (signal(SIGINT, sigHandler) == SIG_ERR) { exit(-1); } /* kill pid / killall name */ if (signal(SIGTERM, sigHandler) == SIG_ERR) { exit(-1); } int err = 0; DisplayCenter monitor; monitor.PutMsg(DisType::Dis_Welcome, 0, ClearScreen::All); if(err == 0) { while(1) { if(getchar() == 'e') { if(getchar() == 'x') { if(getchar() == 'i') { if(getchar() == 't') break; } } } } } return 0; }