Skip to content

Commit

Permalink
Revert "kodi: update sigterm handler patch"
Browse files Browse the repository at this point in the history
This reverts commit 7421d90.
  • Loading branch information
stefansaraev committed Dec 16, 2014
1 parent 7421d90 commit 6597a82
Showing 1 changed file with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -137,22 +137,21 @@ 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"
+#include "Application.h"
+
+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[])
Expand All @@ -166,6 +165,3 @@ index ec86426..c20d793 100644
// set up some xbmc specific relationships
XBMC::Context context;

--
2.1.0

0 comments on commit 6597a82

Please sign in to comment.