aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/config/dbus-core.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-02-07 23:46:30 +0100
committermarha <marha@users.sourceforge.net>2014-02-07 23:46:30 +0100
commit6daf40f6b1138efad98dbb579cd35520cbc349bb (patch)
tree7f45dbb347f5e1a73b18a720633b9d801c968490 /xorg-server/config/dbus-core.c
parent5c64f94cf4cf8457a5616fe20b9a27174895f1a8 (diff)
parent982ac918afe6a1c02d5cf735d7b6c56443a048cc (diff)
downloadvcxsrv-6daf40f6b1138efad98dbb579cd35520cbc349bb.tar.gz
vcxsrv-6daf40f6b1138efad98dbb579cd35520cbc349bb.tar.bz2
vcxsrv-6daf40f6b1138efad98dbb579cd35520cbc349bb.zip
Merge remote-tracking branch 'origin/released'
* origin/released: xkbcomp xkeyboard-config libxcb libxtrans fontconfig libX11 libxcb mesa xserver git update 7 Feb 2014 Conflicts: mesalib/src/glsl/glcpp/glcpp.c openssl/Makefile
Diffstat (limited to 'xorg-server/config/dbus-core.c')
-rw-r--r--xorg-server/config/dbus-core.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/xorg-server/config/dbus-core.c b/xorg-server/config/dbus-core.c
index 768a98454..b0fd92de4 100644
--- a/xorg-server/config/dbus-core.c
+++ b/xorg-server/config/dbus-core.c
@@ -30,9 +30,9 @@
#include <dbus/dbus.h>
#include <sys/select.h>
-#include "config-backends.h"
#include "dix.h"
#include "os.h"
+#include "dbus-core.h"
/* How often to attempt reconnecting when we get booted off the bus. */
#define RECONNECT_DELAY (10 * 1000) /* in ms */
@@ -41,7 +41,7 @@ struct dbus_core_info {
int fd;
DBusConnection *connection;
OsTimerPtr timer;
- struct config_dbus_core_hook *hooks;
+ struct dbus_core_hook *hooks;
};
static struct dbus_core_info bus_info;
@@ -74,7 +74,7 @@ block_handler(void *data, struct timeval **tv, void *read_mask)
static void
teardown(void)
{
- struct config_dbus_core_hook *hook;
+ struct dbus_core_hook *hook;
if (bus_info.timer) {
TimerFree(bus_info.timer);
@@ -112,7 +112,7 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data)
* reconnect immediately (assuming it's just a restart). The
* connection isn't valid at this point, so throw it out immediately. */
if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) {
- DebugF("[config/dbus-core] disconnected from bus\n");
+ DebugF("[dbus-core] disconnected from bus\n");
bus_info.connection = NULL;
teardown();
@@ -136,12 +136,12 @@ static int
connect_to_bus(void)
{
DBusError error;
- struct config_dbus_core_hook *hook;
+ struct dbus_core_hook *hook;
dbus_error_init(&error);
bus_info.connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
if (!bus_info.connection || dbus_error_is_set(&error)) {
- DebugF("[config/dbus-core] error connecting to system bus: %s (%s)\n",
+ LogMessage(X_ERROR, "dbus-core: error connecting to system bus: %s (%s)\n",
error.name, error.message);
goto err_begin;
}
@@ -150,13 +150,13 @@ connect_to_bus(void)
dbus_connection_set_exit_on_disconnect(bus_info.connection, FALSE);
if (!dbus_connection_get_unix_fd(bus_info.connection, &bus_info.fd)) {
- ErrorF("[config/dbus-core] couldn't get fd for system bus\n");
+ ErrorF("[dbus-core] couldn't get fd for system bus\n");
goto err_unref;
}
if (!dbus_connection_add_filter(bus_info.connection, message_filter,
&bus_info, NULL)) {
- ErrorF("[config/dbus-core] couldn't add filter: %s (%s)\n", error.name,
+ ErrorF("[dbus-core] couldn't add filter: %s (%s)\n", error.name,
error.message);
goto err_fd;
}
@@ -198,9 +198,9 @@ reconnect_timer(OsTimerPtr timer, CARD32 time, void *arg)
}
int
-config_dbus_core_add_hook(struct config_dbus_core_hook *hook)
+dbus_core_add_hook(struct dbus_core_hook *hook)
{
- struct config_dbus_core_hook **prev;
+ struct dbus_core_hook **prev;
for (prev = &bus_info.hooks; *prev; prev = &(*prev)->next);
@@ -215,9 +215,9 @@ config_dbus_core_add_hook(struct config_dbus_core_hook *hook)
}
void
-config_dbus_core_remove_hook(struct config_dbus_core_hook *hook)
+dbus_core_remove_hook(struct dbus_core_hook *hook)
{
- struct config_dbus_core_hook **prev;
+ struct dbus_core_hook **prev;
for (prev = &bus_info.hooks; *prev; prev = &(*prev)->next) {
if (*prev == hook) {
@@ -228,19 +228,19 @@ config_dbus_core_remove_hook(struct config_dbus_core_hook *hook)
}
int
-config_dbus_core_init(void)
+dbus_core_init(void)
{
memset(&bus_info, 0, sizeof(bus_info));
bus_info.fd = -1;
bus_info.hooks = NULL;
- bus_info.connection = NULL;
- bus_info.timer = TimerSet(NULL, 0, 1, reconnect_timer, NULL);
+ if (!connect_to_bus())
+ bus_info.timer = TimerSet(NULL, 0, 1, reconnect_timer, NULL);
return 1;
}
void
-config_dbus_core_fini(void)
+dbus_core_fini(void)
{
teardown();
}