/* bus.c message bus context object
*
* Copyright (C) 2003, 2004 Red Hat, Inc.
+ * Copyright (C) 2013 Samsung Electronics
*
* Licensed under the Academic Free License version 2.1
*
#include <dbus/dbus-hash.h>
#include <dbus/dbus-credentials.h>
#include <dbus/dbus-internals.h>
+
+#ifdef ENABLE_KDBUS_TRANSPORT
#include "kdbus-d.h"
#include <stdlib.h>
+#endif
#ifdef DBUS_CYGWIN
#include <signal.h>
unsigned int keep_umask : 1;
unsigned int allow_anonymous : 1;
unsigned int systemd_activation : 1;
+#ifdef ENABLE_KDBUS_TRANSPORT
DBusConnection *myKdbusConnection; //todo maybe can be rafctored and removed
+#endif
};
static dbus_int32_t server_data_slot = -1;
if (address)
{
+#ifdef ENABLE_KDBUS_TRANSPORT
if(!strcmp(_dbus_string_get_const_data(address), "kdbus"))
{
DBusBusType type;
goto failed;
}
else
- {
+#endif
+ {
DBusServer *server;
server = dbus_server_listen (_dbus_string_get_const_data(address), error);
goto failed;
}
context->refcount = 1;
+
+#ifdef ENABLE_KDBUS_TRANSPORT
context->myKdbusConnection = NULL;
+#endif
_dbus_generate_uuid (&context->uuid);
dbus_server_free_data_slot (&server_data_slot);
+#ifdef ENABLE_KDBUS_TRANSPORT
if(context->myKdbusConnection)
{
DBusString unique_name;
goto failed;
}
}
+#endif
return context;
goto failed;
}
+#ifdef ENABLE_KDBUS_TRANSPORT
if(context->myKdbusConnection)
{
if(!update_kdbus_starters(context->myKdbusConnection))
goto failed;
}
}
+#endif
+
ret = TRUE;
bus_context_log (context, DBUS_SYSTEM_LOG_INFO, "Reloaded configuration");
return context->loop;
}
-DBusConnection* bus_context_get_myConnection(BusContext *context)
-{
- return context->myKdbusConnection;
-}
-
dbus_bool_t
bus_context_allow_unix_user (BusContext *context,
unsigned long uid)
return context->limits.reply_timeout;
}
+#ifdef ENABLE_KDBUS_TRANSPORT
dbus_bool_t bus_context_is_kdbus(BusContext* context)
{
return context->myKdbusConnection != NULL;
}
+#endif
void
bus_context_log (BusContext *context, DBusSystemLogSeverity severity, const char *msg, ...) _DBUS_GNUC_PRINTF (3, 4);