projects
/
vuplus_dvbapp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f291fd2
)
shutdown enigma on SIGTERM
author
Andreas Oberritter
<obi@opendreambox.org>
Thu, 4 Nov 2010 20:08:56 +0000
(21:08 +0100)
committer
Andreas Oberritter
<obi@opendreambox.org>
Tue, 16 Nov 2010 16:15:38 +0000
(17:15 +0100)
main/enigma.cpp
patch
|
blob
|
history
diff --git
a/main/enigma.cpp
b/main/enigma.cpp
index
6bc3571
..
1cdd867
100644
(file)
--- a/
main/enigma.cpp
+++ b/
main/enigma.cpp
@@
-268,11
+268,6
@@
eApplication *getApplication()
return eApp;
}
return eApp;
}
-void runMainloop()
-{
- eApp->runLoop();
-}
-
void quitMainloop(int exitCode)
{
FILE *f = fopen("/proc/stb/fp/was_timer_wakeup", "w");
void quitMainloop(int exitCode)
{
FILE *f = fopen("/proc/stb/fp/was_timer_wakeup", "w");
@@
-297,6
+292,26
@@
void quitMainloop(int exitCode)
eApp->quit(0);
}
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;
const char *getEnigmaVersionString()
{
std::string date = enigma2_date;