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.
This commit is contained in:
Axel Dörfler 2015-07-06 08:59:59 +02:00
parent 05a567f609
commit 06e0f8079f
2 changed files with 10 additions and 23 deletions

View File

@ -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 <SupportDefs.h>
// 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

View File

@ -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) {