#include <lib/python/python.h>
#include "bsod.h"
+#include "version_info.h"
#include <gst/gst.h>
return eApp;
}
-void runMainloop()
-{
- eApp->runLoop();
-}
-
void quitMainloop(int exitCode)
{
FILE *f = fopen("/proc/stb/fp/was_timer_wakeup", "w");
eApp->quit(0);
}
-#include "version.h"
+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 =
-#ifdef ENIGMA2_LAST_CHANGE_DATE
- ENIGMA2_LAST_CHANGE_DATE;
-#else
- __DATE__;
-#endif
- std::string branch =
-#ifdef ENIGMA2_BRANCH
- ENIGMA2_BRANCH;
-#else
- "HEAD";
-#endif
+ std::string date = enigma2_date;
+ std::string branch = enigma2_branch;
return std::string(date + '-' + branch).c_str();
}