* Now dumps a message to the serial debug output in case a GUI server died; if the

registrar or the input_server died, you didn't get any notification before.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18970 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-09-28 15:47:44 +00:00
parent 633d2d3d4e
commit 8b4fbcf3ad
+7 -7
View File
@@ -567,7 +567,8 @@ TeamDebugHandler::_HandleMessage(DebugMessage *message)
if (_IsGUIServer()) { if (_IsGUIServer()) {
// App or input server. If it's the app server, we'll try to debug it. // App or input server. If it's the app server, we'll try to debug it.
kill = !(_IsAppServer() && strlen(fExecutablePath) > 0); kill = !(_IsAppServer() && strlen(fExecutablePath) > 0);
debug_printf("*** GUI server died: thread %ld, %s: %s\n", thread, fExecutablePath, buffer);
// TODO: for now, so that we know what's going on
} else if (USE_GUI && _AreGUIServersAlive() && _InitGUI() == B_OK) { } else if (USE_GUI && _AreGUIServersAlive() && _InitGUI() == B_OK) {
// normal app // normal app
@@ -792,7 +793,6 @@ TeamDebugHandler::_HandlerThread()
} }
delete message; delete message;
} while (!terminate); } while (!terminate);
} else } else
kill = true; kill = true;
@@ -814,7 +814,7 @@ TeamDebugHandler::_HandlerThread()
bool bool
TeamDebugHandler::_ExecutableNameEquals(const char *name) const TeamDebugHandler::_ExecutableNameEquals(const char *name) const
{ {
return (strcmp(_LastPathComponent(fExecutablePath), name) == 0); return strcmp(_LastPathComponent(fExecutablePath), name) == 0;
} }
// _IsAppServer // _IsAppServer
@@ -843,7 +843,7 @@ bool
TeamDebugHandler::_IsGUIServer() const TeamDebugHandler::_IsGUIServer() const
{ {
// app or input server // app or input server
return (_IsAppServer() || _IsInputServer() || _IsRegistrar()); return _IsAppServer() || _IsInputServer() || _IsRegistrar();
} }
// _LastPathComponent // _LastPathComponent
@@ -851,7 +851,7 @@ const char *
TeamDebugHandler::_LastPathComponent(const char *path) TeamDebugHandler::_LastPathComponent(const char *path)
{ {
const char *lastSlash = strrchr(path, '/'); const char *lastSlash = strrchr(path, '/');
return (lastSlash ? lastSlash + 1 : path); return lastSlash ? lastSlash + 1 : path;
} }
// _FindTeam // _FindTeam
@@ -876,8 +876,8 @@ TeamDebugHandler::_FindTeam(const char *name)
bool bool
TeamDebugHandler::_AreGUIServersAlive() TeamDebugHandler::_AreGUIServersAlive()
{ {
return (_FindTeam("app_server") >= 0 && _FindTeam("input_server") >= 0 return _FindTeam("app_server") >= 0 && _FindTeam("input_server") >= 0
&& _FindTeam("registrar")); && _FindTeam("registrar");
} }