#define MSGPORT_DBUS_SERVER_GET_PRIV(obj) \
G_TYPE_INSTANCE_GET_PRIVATE ((obj), MSGPORT_TYPE_DBUS_SERVER, MsgPortDbusServerPrivate)
-#ifndef MESSAGEPORT_BUS_ADDRESS
-# define MESSAGEPORT_BUS_ADDRESS "unix:path=%s/.message-port"
-#endif /* MESSAGEPORT_BUS_ADDRESS */
-
enum
{
PROP_0,
MsgPortDbusServer *
msgport_dbus_server_new () {
MsgPortDbusServer *server = NULL;
- gchar *address = g_strdup_printf (MESSAGEPORT_BUS_ADDRESS); //, g_get_user_runtime_dir());
+ gchar *address = NULL;
+
+ if (g_getenv("MESSAGEPORT_BUS_ADDRESS")) {
+ address = g_strdup (g_getenv ("MESSAGEPORT_BUS_ADDRESS"));
+ }
+ else {
+# ifdef MESSAGEPORT_BUS_ADDRESS
+ address = g_strdup_printf (MESSAGEPORT_BUS_ADDRESS);
+# endif
+ }
+ if (!address)
+ address = g_strdup_printf ("unix:path=%s/.message-port", g_get_user_runtime_dir());
server = msgport_dbus_server_new_with_address (address);
g_free (address);