Beispiel #1
0
status_t
BPrivate::send_request_to_launch_daemon(KMessage& request, KMessage& reply)
{
	status_t status = request.SendTo(get_launch_daemon_port(),
		B_PREFERRED_TOKEN, &reply);
	if (status != B_OK)
		return status;

	return (status_t)reply.What();
}
status_t
BPrivate::send_authentication_request_to_registrar(KMessage& request,
	KMessage& reply)
{
	status_t error = request.SendTo(get_registrar_authentication_port(), 0,
		&reply);
	if (error != B_OK)
		return error;

	return (status_t)reply.What();
}
status_t
LocalDebuggerInterface::_GetNextSystemWatchEvent(DebugEvent*& _event,
	KMessage& message)
{
	status_t error = B_OK;
	if (message.What() != B_SYSTEM_OBJECT_UPDATE)
		return B_BAD_DATA;

	int32 opcode = 0;
	if (message.FindInt32("opcode", &opcode) != B_OK)
		return B_BAD_DATA;

	DebugEvent* event = NULL;
	switch (opcode)
	{
		case B_THREAD_NAME_CHANGED:
		{
			int32 threadID = -1;
			if (message.FindInt32("thread", &threadID) != B_OK)
				break;

			thread_info info;
			error = get_thread_info(threadID, &info);
			if (error != B_OK)
				break;

			event = new(std::nothrow) ThreadRenamedEvent(fTeamID,
				threadID, threadID, info.name);
			break;
		}

		default:
		{
			error = B_BAD_DATA;
			break;
		}
	}

	if (event != NULL)
		_event = event;

	return error;
}