return eApp;
}
-void runMainloop()
-{
- eApp->runLoop();
-}
-
void quitMainloop(int exitCode)
{
FILE *f = fopen("/proc/stb/fp/was_timer_wakeup", "w");
eApp->quit(0);
}
+static void sigterm_handler(int num)
+{
+ quitMainloop(128 + num);
+}
+
+void runMainloop()
+{
+ struct sigaction act;
+
+ act.sa_handler = sigterm_handler;
+ act.sa_flags = SA_RESTART;
+
+ if (sigemptyset(&act.sa_mask) == -1)
+ perror("sigemptyset");
+ if (sigaction(SIGTERM, &act, 0) == -1)
+ perror("SIGTERM");
+
+ eApp->runLoop();
+}
+
const char *getEnigmaVersionString()
{
std::string date = enigma2_date;