Revert "kodi: update sigterm handler patch"

This reverts commit 7421d90ad9c46b6c76267a4c2e15fdadfc01fb21.
This commit is contained in:
Stefan Saraev 2014-12-16 14:15:44 +02:00
parent 7421d90ad9
commit 6597a82384

View File

@ -1,6 +1,6 @@
From 4ed7bee82ee9daa22e5675fd98ef97bf05c10d6b Mon Sep 17 00:00:00 2001
From eabb811c7f82695cb566b0aadf5d86cb7448368a Mon Sep 17 00:00:00 2001
From: Stefan Saraev <stefan@saraev.ca>
Date: Mon, 15 Dec 2014 21:28:54 +0200
Date: Thu, 5 Jun 2014 18:50:04 +0300
Subject: [PATCH] handle SIGTERM
In some situations, due to deadlocks or crashes, xbmc fails to exit properly in
@ -27,11 +27,11 @@ is requested externaly (ssh, 3rdparty script).
xbmc/ApplicationMessenger.cpp | 6 ++++--
xbmc/XBApplicationEx.cpp | 1 +
xbmc/XBApplicationEx.h | 1 +
xbmc/main/main.cpp | 16 ++++++++++++++++
6 files changed, 31 insertions(+), 4 deletions(-)
xbmc/main/main.cpp | 15 +++++++++++++++
6 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index da6a327..0570df9 100644
index 875ca39..9572b62 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -3477,12 +3477,19 @@ bool CApplication::Cleanup()
@ -67,7 +67,7 @@ diff --git a/xbmc/Application.h b/xbmc/Application.h
index 0a332ff..a4d6b58 100644
--- a/xbmc/Application.h
+++ b/xbmc/Application.h
@@ -153,6 +153,7 @@ public:
@@ -153,6 +153,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
bool StartPVRManager();
void StopPVRManager();
bool IsCurrentThread() const;
@ -128,7 +128,7 @@ diff --git a/xbmc/XBApplicationEx.h b/xbmc/XBApplicationEx.h
index c46cba1..ed3f35f 100644
--- a/xbmc/XBApplicationEx.h
+++ b/xbmc/XBApplicationEx.h
@@ -40,6 +40,7 @@ public:
@@ -40,6 +40,7 @@ class CXBApplicationEx : public IWindowManagerCallback
// Variables for timing
bool m_bStop;
int m_ExitCode;
@ -137,10 +137,10 @@ index c46cba1..ed3f35f 100644
bool m_renderGUI;
diff --git a/xbmc/main/main.cpp b/xbmc/main/main.cpp
index ec86426..c20d793 100644
index ec86426..ad8fe6e 100644
--- a/xbmc/main/main.cpp
+++ b/xbmc/main/main.cpp
@@ -40,9 +40,25 @@
@@ -40,9 +40,24 @@
#include "input/linux/LIRC.h"
#endif
#include "XbmcContext.h"
@ -148,11 +148,10 @@ index ec86426..c20d793 100644
+
+void xbmc_term_handler(int signum)
+{
+ if (!g_application.m_ExitCodeSet) {
+ CLog::Log(LOGINFO, "Received SIGTERM...");
+ CLog::Log(LOGINFO, "Received SIGTERM...");
+ if (!g_application.m_ExitCodeSet)
+ g_application.SetExitCode(EXITCODE_RESTARTAPP);
+ g_application.Stop(EXITCODE_RESTARTAPP);
+ }
+ g_application.Stop(EXITCODE_RESTARTAPP);
+}
int main(int argc, char* argv[])
@ -166,6 +165,3 @@ index ec86426..c20d793 100644
// set up some xbmc specific relationships
XBMC::Context context;
--
2.1.0