From 06e0f8079fbd47d06d30438d60ea0563af339a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 6 Jul 2015 08:59:59 +0200 Subject: [PATCH] registrar: Fixed app_server detection. * This also fixes the shutdown process, as the registrar no longer kills the app_server. * Removed SERVER_PORT_NAME definition as it has no use anymore. --- headers/private/app/ServerProtocol.h | 11 +---------- src/servers/registrar/TRoster.cpp | 22 +++++++++------------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/headers/private/app/ServerProtocol.h b/headers/private/app/ServerProtocol.h index e85f774ba6..952a6111dd 100644 --- a/headers/private/app/ServerProtocol.h +++ b/headers/private/app/ServerProtocol.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2012, Haiku. + * Copyright 2001-2015, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -15,15 +15,6 @@ #include -// Server port names. The input port is the port which is used to receive -// input messages from the Input Server. The other is the "main" port for -// the server and is utilized mostly by BApplication objects. -#ifdef HAIKU_TARGET_PLATFORM_HAIKU -# define SERVER_PORT_NAME "system:app_server" -#else -# define SERVER_PORT_NAME "haiku-test:app_server" -#endif - #if TEST_MODE # define SERVER_INPUT_PORT "haiku-test:input port" #endif diff --git a/src/servers/registrar/TRoster.cpp b/src/servers/registrar/TRoster.cpp index dab9b8f644..a930adf6c9 100644 --- a/src/servers/registrar/TRoster.cpp +++ b/src/servers/registrar/TRoster.cpp @@ -1430,23 +1430,19 @@ TRoster::GetShutdownApps(AppInfoList& userApps, AppInfoList& systemApps, vitalSystemApps.insert(teamInfo.team); // app server - port_id appServerPort = find_port(SERVER_PORT_NAME); - port_info portInfo; - if (appServerPort >= 0 - && get_port_info(appServerPort, &portInfo) == B_OK) { - vitalSystemApps.insert(portInfo.team); - } + RosterAppInfo* info + = fRegisteredApps.InfoFor("application/x-vnd.haiku-app_server"); + if (info != NULL) + vitalSystemApps.insert(info->team); // debug server - RosterAppInfo* info = - fRegisteredApps.InfoFor("application/x-vnd.haiku-debug_server"); - if (info) + info = fRegisteredApps.InfoFor("application/x-vnd.haiku-debug_server"); + if (info != NULL) vitalSystemApps.insert(info->team); // populate the other groups for (AppInfoList::Iterator it(fRegisteredApps.It()); - RosterAppInfo* info = *it; - ++it) { + RosterAppInfo* info = *it; ++it) { if (vitalSystemApps.find(info->team) == vitalSystemApps.end()) { RosterAppInfo* clonedInfo = info->Clone(); if (clonedInfo) { @@ -1474,8 +1470,8 @@ TRoster::GetShutdownApps(AppInfoList& userApps, AppInfoList& systemApps, // Special case, we add the input server to vital apps here so it is // not excluded in the lists above info = fRegisteredApps.InfoFor("application/x-vnd.Be-input_server"); - if (info) - vitalSystemApps.insert(info->team); + if (info != NULL) + vitalSystemApps.insert(info->team); // clean up on error if (error != B_OK) {