summaryrefslogtreecommitdiff
path: root/src/manager-lib/nativeruntime.cpp
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@pelagicore.com>2019-08-01 17:05:45 +0200
committerRobert Griebl <robert.griebl@pelagicore.com>2019-08-03 23:22:24 +0200
commita19ca805b669e20e5f3712cb9420726c965dc4bf (patch)
treea15b0bfa1d9f56f65dbed21b475278591310cfd3 /src/manager-lib/nativeruntime.cpp
parented9dea417c1346183de52782459eb0b697778245 (diff)
downloadqtapplicationmanager-a19ca805b669e20e5f3712cb9420726c965dc4bf.tar.gz
Cleanup the NativeRuntime exit status handling
The console message for a forced quit of an AM app always stated 'CrashExit', which was wrong - the correct 'ForceExit' status was only calculated afterwards. Change-Id: I69f896a944b3bccf04cf8eff965f2785dab6c55a Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Diffstat (limited to 'src/manager-lib/nativeruntime.cpp')
-rw-r--r--src/manager-lib/nativeruntime.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/manager-lib/nativeruntime.cpp b/src/manager-lib/nativeruntime.cpp
index 7fffb626..f32c7ff2 100644
--- a/src/manager-lib/nativeruntime.cpp
+++ b/src/manager-lib/nativeruntime.cpp
@@ -75,6 +75,7 @@ QT_BEGIN_NAMESPACE_AM
QT_END_NAMESPACE_AM
# include <dlfcn.h>
# include <sys/socket.h>
+# include <signal.h>
QT_BEGIN_NAMESPACE_AM
static qint64 getDBusPeerPid(const QDBusConnection &conn)
@@ -223,6 +224,10 @@ bool NativeRuntime::initialize()
void NativeRuntime::shutdown(int exitCode, Am::ExitStatus status)
{
+ // see NativeRuntime::stop() below
+ if ((status == Am::CrashExit) && (exitCode == SIGTERM || exitCode == SIGKILL))
+ status = Am::ForcedExit;
+
if (!m_isQuickLauncher || m_connectedToRuntimeInterface) {
qCDebug(LogSystem) << "NativeRuntime (id:" << (m_app ? m_app->id() : qSL("(none)"))
<< "pid:" << m_process->processId() << ") exited with code:" << exitCode