diff options
author | Anders Carlsson <andersca@src.gnome.org> | 2003-03-16 17:46:00 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@src.gnome.org> | 2003-03-16 17:46:00 +0000 |
commit | b9a522e8eaf6bf9cc2085ea3e25cd18de935b49a (patch) | |
tree | c7f7d85dcf8656af2cddce75dc4da5c7c0f0355e | |
parent | 4b3e763668c9b02bcb83c3e53254fae725094c96 (diff) | |
download | gconf-b9a522e8eaf6bf9cc2085ea3e25cd18de935b49a.tar.gz |
It kinda runs GNOME now
-rw-r--r-- | .cvsignore | 1 | ||||
-rw-r--r-- | Makefile.am | 12 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | gconf-2.0.pc.in | 2 | ||||
-rw-r--r-- | gconf/Makefile.am | 2 | ||||
-rw-r--r-- | gconf/default.path.in | 2 | ||||
-rw-r--r-- | gconf/gconf-dbus.h | 1 | ||||
-rw-r--r-- | gconf/gconf-internals.c | 60 | ||||
-rw-r--r-- | gconf/gconf-internals.h | 7 | ||||
-rw-r--r-- | gconf/gconf.c | 498 | ||||
-rw-r--r-- | gconf/gconfd-dbus.c | 43 | ||||
-rw-r--r-- | gconf/gconftool.c | 8 | ||||
-rw-r--r-- | gconf/simple-test.c | 27 | ||||
-rw-r--r-- | gconfd.service.in | 3 | ||||
-rw-r--r-- | tests/dbus-glue.c | 19 | ||||
-rwxr-xr-x | tests/testactivationraces.sh | 12 |
16 files changed, 412 insertions, 287 deletions
@@ -22,3 +22,4 @@ gconf-config gconf-2.0.pc gconf.spec gconf.m4 +gconfd.service diff --git a/Makefile.am b/Makefile.am index ac77099f..ac9f2d35 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS = gconf backends po doc examples DIST_SUBDIRS=tests $(SUBDIRS) EXTRA_DIST=gconf.m4.in gconf.spec.in gconf.spec TODO \ - gconf-2.0.pc.in + gconf-2.0.pc.in gconfd.service.in install-data-local: -mkdir -p $(DESTDIR)$(datadir)/aclocal @@ -16,5 +16,15 @@ install-data-local: pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gconf-2.0.pc +servicedir = $(datadir)/dbus/services + +service_DATA = gconfd.service + +gconfd.service: gconfd.service.in + sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" $< > $@ + +CLEANFILES = gconfd.service + install-schemas: (cd standard-schemas && $(MAKE) $(AM_MAKEFLAGS) install-schemas) + diff --git a/configure.in b/configure.in index f126e9a1..1d66804c 100644 --- a/configure.in +++ b/configure.in @@ -176,7 +176,7 @@ AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) -PKGCONFIG_MODULES='gmodule-2.0 >= 2.0.1 gobject-2.0 >= 2.0.1 ORBit-2.0 >= 2.4.0 linc >= 0.5.0 dbus-glib-1.0 >= 0.5' +PKGCONFIG_MODULES='gmodule-2.0 >= 2.2.0 gobject-2.0 >= 2.2.0 ORBit-2.0 >= 2.4.0 linc >= 0.5.0 dbus-glib-1.0 >= 0.5' PKGCONFIG_MODULES_WITH_XML="$PKGCONFIG_MODULES libxml-2.0" PKGCONFIG_MODULES_WITH_GTK=" $PKGCONFIG_MODULES gtk+-2.0 >= 2.0.0" PKGCONFIG_MODULES_WITH_XML_AND_GTK=" $PKGCONFIG_MODULES gtk+-2.0 libxml-2.0" diff --git a/gconf-2.0.pc.in b/gconf-2.0.pc.in index 04c3003f..5e7de650 100644 --- a/gconf-2.0.pc.in +++ b/gconf-2.0.pc.in @@ -8,6 +8,6 @@ gconf_serverdir=@libexecdir@ Name: gconf Description: GNOME Config System. Version: @VERSION@ -Requires: ORBit-2.0 +Requires: ORBit-2.0 dbus-glib-1.0 Libs: -L${libdir} -lgconf-@MAJOR_VERSION@ Cflags: -I${includedir}/gconf/@MAJOR_VERSION@ diff --git a/gconf/Makefile.am b/gconf/Makefile.am index aceeff6a..9febd027 100644 --- a/gconf/Makefile.am +++ b/gconf/Makefile.am @@ -126,7 +126,7 @@ libgconf_2_la_SOURCES = \ libgconf_2_la_LDFLAGS = -version-info $(GCONF_CURRENT):$(GCONF_REVISION):$(GCONF_AGE) -libgconf_2_la_LIBADD = $(INTLLIBS) $(DEPENDENT_LIBS) +libgconf_2_la_LIBADD = $(DEPENDENT_LIBS) $(INTLLIBS) EXTRA_DIST=GConfX.idl default.path.in gconfmarshal.list regenerate-enum-header.sh regenerate-enum-footer.sh diff --git a/gconf/default.path.in b/gconf/default.path.in index 8ac417f9..0e476d77 100644 --- a/gconf/default.path.in +++ b/gconf/default.path.in @@ -15,7 +15,7 @@ include "$(HOME)/.gconf.path" # Give users a default storage location, ~/.gconf -xml:readwrite:$(HOME)/.gconfd +xml:readwrite:$(HOME)/.gconf-dbus # Finally, look at the systemwide defaults # (commented out for now) diff --git a/gconf/gconf-dbus.h b/gconf/gconf-dbus.h index 5c42e592..919e676a 100644 --- a/gconf/gconf-dbus.h +++ b/gconf/gconf-dbus.h @@ -26,6 +26,7 @@ #define GCONF_DBUS_CONFIG_SERVER "org.gnome.GConf.Server" #define GCONF_DBUS_CONFIG_SERVER_SHUTDOWN "org.gnome.GConf.Server.Shutdown" +#define GCONF_DBUS_CONFIG_SERVER_PING "org.gnome.GConf.Server.Ping" #define GCONF_DBUS_CONFIG_DATABASE_DIR_EXISTS "org.gnome.GConf.Database.DirExists" #define GCONF_DBUS_CONFIG_DATABASE_ALL_DIRS "org.gnome.GConf.Database.AllDirs" diff --git a/gconf/gconf-internals.c b/gconf/gconf-internals.c index c9c5dc2b..189beb66 100644 --- a/gconf/gconf-internals.c +++ b/gconf/gconf-internals.c @@ -1,6 +1,7 @@ /* GConf * Copyright (C) 1999, 2000 Red Hat Inc. + * Copyright (C) 2003 CodeFactory AB * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -22,6 +23,7 @@ #include "gconf-internals.h" #include "gconf-backend.h" #include "gconf-schema.h" +#include "gconf-dbus.h" #include "gconf.h" #include <string.h> #include <sys/stat.h> @@ -2794,10 +2796,61 @@ close_fd_func (gpointer data) } } -ConfigServer -gconf_activate_server (gboolean start_if_not_found, - GError **error) +gboolean +gconf_activate_server (DBusConnection *connection, + gboolean start_if_not_found, + GError **error) { + DBusMessage *message, *reply; + + /* Confirm server exists */ + message = dbus_message_new (GCONF_DBUS_CONFIG_SERVER, GCONF_DBUS_CONFIG_SERVER_PING); + + reply = dbus_connection_send_with_reply_and_block (connection, message, -1, NULL); + dbus_message_unref (message); + + if (!dbus_message_get_is_error (reply)) + return TRUE; + + printf ("woohoo: %d\n", start_if_not_found); + + if (start_if_not_found) + { + message = dbus_message_new (DBUS_SERVICE_DBUS, + DBUS_MESSAGE_ACTIVATE_SERVICE); + dbus_message_append_args (message, + DBUS_TYPE_STRING, GCONF_DBUS_CONFIG_SERVER, + DBUS_TYPE_UINT32, 0, + 0); + + reply = dbus_connection_send_with_reply_and_block (connection, message, -1, NULL); + + if (dbus_message_get_is_error (reply)) + { + char *error_message; + + dbus_message_get_args (reply, NULL, + DBUS_TYPE_STRING, &error_message, + 0); + g_set_error (error, GCONF_ERROR, + GCONF_ERROR_NO_SERVER, + _("Failed to activate configuration server: %s\n"), + error_message); + dbus_free (error_message); + dbus_message_unref (reply); + + return FALSE; + } + else + { + dbus_message_unref (reply); + return TRUE; + } + } + + return FALSE; + +#ifdef GCONF_CORBA_BROKEN ConfigServer server; int p[2] = { -1, -1 }; char buf[1]; @@ -2914,6 +2967,7 @@ gconf_activate_server (gboolean start_if_not_found, close (p[1]); return server; +#endif } gboolean diff --git a/gconf/gconf-internals.h b/gconf/gconf-internals.h index 12efdc30..8fe2dc81 100644 --- a/gconf/gconf-internals.h +++ b/gconf/gconf-internals.h @@ -38,7 +38,7 @@ #include "gconf-engine.h" #include "gconf-sources.h" #include "GConfX.h" - +#include "gconf-dbus.h" gchar* gconf_key_directory (const gchar* key); const gchar* gconf_key_key (const gchar* key); @@ -202,8 +202,9 @@ GError* gconf_compose_errors (GError* err1, GError* err2); CORBA_ORB gconf_orb_get (void); -ConfigServer gconf_activate_server (gboolean start_if_not_found, - GError **error); +gboolean gconf_activate_server (DBusConnection *connection, + gboolean start_if_not_found, + GError **error); char* gconf_get_lock_dir (void); char* gconf_get_daemon_dir (void); diff --git a/gconf/gconf.c b/gconf/gconf.c index fa338919..00fc8c10 100644 --- a/gconf/gconf.c +++ b/gconf/gconf.c @@ -34,9 +34,8 @@ #include <sys/time.h> #include <unistd.h> -/* Returns TRUE if there was an error, frees exception, sets err */ -static gboolean gconf_handle_corba_exception(CORBA_Environment* ev, GError** err); -static gboolean gconf_handle_dbus_exception (DBusMessage *message, GError** err); +/* Returns TRUE if there was an error, frees dbus_error and sets err */ +static gboolean gconf_handle_dbus_exception (DBusMessage *message, DBusError *dbus_error, GError** err); /* just returns TRUE if there's an exception indicating the server is probably hosed; no side effects */ @@ -126,8 +125,8 @@ static void gconf_cnxn_notify (GConfCnxn *cnxn, GConfEntry *entry); -static ConfigServer gconf_get_config_server (gboolean start_if_not_found, - GError **err); +static gboolean gconf_get_config_server (gboolean start_if_not_found, + GError **err); /* Forget our current server object reference, so the next call to gconf_get_config_server will have to try to respawn the server */ @@ -258,7 +257,7 @@ lookup_engine_by_database (int db) } /* FIXME: Don't assume this */ -static gboolean daemon_running = TRUE; +static gboolean daemon_running = FALSE; static void gconf_engine_set_database (GConfEngine *conf, @@ -289,55 +288,21 @@ gconf_engine_connect (GConfEngine *conf, gboolean start_if_not_found, GError **err) { - ConfigServer cs; - ConfigDatabase db; - int tries = 0; - CORBA_Environment ev; + int db; g_return_val_if_fail (!conf->is_local, TRUE); - CORBA_exception_init(&ev); - - if (conf->database != -1) + if (daemon_running && conf->database != -1) return TRUE; - /* FIXME: Don't do this */ - gconf_engine_set_database (conf, 0); - return TRUE; - - RETRY: - - cs = gconf_get_config_server(start_if_not_found, err); - - if (cs == CORBA_OBJECT_NIL) - return FALSE; /* Error should already be set */ + if (!gconf_get_config_server(start_if_not_found, err)) + return FALSE; if (conf->is_default) - db = ConfigServer_get_default_database (cs, &ev); + db = 0; else - db = ConfigServer_get_database (cs, conf->address, &ev); - - if (gconf_server_broken(&ev)) { - if (tries < MAX_RETRIES) - { - ++tries; - CORBA_exception_free(&ev); - gconf_detach_config_server(); - goto RETRY; - } - } - - if (gconf_handle_corba_exception(&ev, err)) - return FALSE; - - if (CORBA_Object_is_nil (db, &ev)) - { - if (err) - *err = gconf_error_new(GCONF_ERROR_BAD_ADDRESS, - _("Server couldn't resolve the address `%s'"), - conf->address ? conf->address : "default"); - + g_warning ("Using databases other than the default one is currently not supported."); return FALSE; } @@ -351,9 +316,6 @@ gconf_engine_get_database (GConfEngine *conf, gboolean start_if_not_found, GError **err) { - /* FIXME: */ - return 0; - if (!gconf_engine_connect (conf, start_if_not_found, err)) return -1; else @@ -404,6 +366,55 @@ lookup_engine (const gchar *address) return NULL; } +static const char * +get_dbus_address (void) +{ + /* FIXME: Change this when we know how to find the message bus. */ + return g_getenv ("DBUS_ADDRESS"); +} + +static gboolean +ensure_dbus_connection (void) +{ + DBusConnection *connection; + DBusError error; + DBusResultCode result; + const char *dbus_address; + + if (dbus_conn) + return TRUE; + + g_warning ("no D-BUS connection specified, creating one"); + + dbus_address = get_dbus_address (); + + if (!dbus_address) + { + g_warning ("Failed to get the D-BUS bus daemon address.\n"); + return FALSE; + } + + connection = dbus_connection_open (dbus_address, &result); + if (!connection) + { + g_warning ("Failed to connect to the D-BUS bus daemon: %s\n.", + dbus_result_to_string (result)); + return FALSE; + } + + dbus_error_init (&error); + if (!dbus_bus_register (connection, &error)) + { + g_warning ("Failed to register client with the D-BUS bus daemon: %s", + error.message); + dbus_error_free (&error); + return FALSE; + } + + dbus_connection_setup_with_g_main (connection); + gconf_init_dbus (connection); + return TRUE; +} /* * Public Interface @@ -445,6 +456,9 @@ gconf_engine_get_default (void) { conf = gconf_engine_blank(TRUE); + if (!ensure_dbus_connection ()) + return NULL; + conf->is_default = TRUE; default_engine = conf; @@ -473,6 +487,9 @@ gconf_engine_get_for_address (const gchar* address, GError** err) { conf = gconf_engine_blank(TRUE); + if (!ensure_dbus_connection ()) + return NULL; + conf->is_default = FALSE; conf->address = g_strdup (address); @@ -516,7 +533,6 @@ gconf_engine_unref(GConfEngine* conf) } else { -#ifdef GCONF_CORBA_BROKEN /* Remove all connections associated with this GConf */ GSList* removed; GSList* tmp; @@ -534,28 +550,13 @@ gconf_engine_unref(GConfEngine* conf) { GConfCnxn* gcnxn = tmp->data; - if (!CORBA_Object_is_nil (conf->database, &ev)) - { - GError* err = NULL; - - ConfigDatabase_remove_listener(conf->database, - gcnxn->server_id, - &ev); - - if (gconf_handle_corba_exception(&ev, &err)) - { - /* Don't set error because realistically this - doesn't matter to clients */ -#ifdef GCONF_ENABLE_DEBUG - g_warning("Failure removing listener %u from the config server: %s", - (guint)gcnxn->server_id, - err->message); -#endif - } - } + if (conf->database != -1) + { + gconf_engine_notify_remove (conf, gcnxn->client_id); + } gconf_cnxn_destroy(gcnxn); - + tmp = g_slist_next(tmp); } @@ -575,7 +576,6 @@ gconf_engine_unref(GConfEngine* conf) gconf_engine_detach (conf); ctable_destroy (conf->ctable); -#endif } if (conf == default_engine) @@ -615,14 +615,14 @@ add_listener (GConfEngine *conf, gulong id; DBusDict *properties; DBusMessage *message, *reply; - + DBusError error; + properties = dbus_dict_new (); dbus_dict_set_string (properties, "name", g_get_prgname () ? g_get_prgname () : "unknown"); RETRY: - message = dbus_message_new (GCONF_DBUS_CONFIG_SERVER, GCONF_DBUS_CONFIG_DATABASE_ADD_LISTENER); dbus_message_append_args (message, @@ -630,24 +630,27 @@ add_listener (GConfEngine *conf, DBUS_TYPE_STRING, namespace_section, DBUS_TYPE_DICT, properties, 0); - dbus_dict_unref (properties); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken (reply)) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } - - if (gconf_handle_dbus_exception(reply, err)) + dbus_dict_unref (properties); + if (gconf_handle_dbus_exception(reply, &error, err)) { - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return 0; } @@ -709,6 +712,7 @@ gconf_engine_notify_remove(GConfEngine* conf, int db; DBusMessage *message, *reply; gint tries = 0; + DBusError error; CHECK_OWNER_USE (conf); @@ -725,30 +729,34 @@ gconf_engine_notify_remove(GConfEngine* conf, gcnxn = ctable_lookup_by_client_id(conf->ctable, client_id); g_return_if_fail(gcnxn != NULL); - message = dbus_message_new (GCONF_DBUS_CONFIG_SERVER, GCONF_DBUS_CONFIG_DATABASE_ADD_LISTENER); + message = dbus_message_new (GCONF_DBUS_CONFIG_SERVER, GCONF_DBUS_CONFIG_DATABASE_REMOVE_LISTENER); dbus_message_append_args (message, DBUS_TYPE_UINT32, db, DBUS_TYPE_UINT32, gcnxn->server_id, 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken (reply)) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } - if (gconf_handle_dbus_exception(reply, NULL)) + if (gconf_handle_dbus_exception(reply, &error, NULL)) ; /* Do nothing */ - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); /* We want to do this even if the CORBA fails, so if we restart gconfd and reinstall listeners we don't reinstall this one. */ @@ -774,6 +782,7 @@ gconf_engine_get_fuller (GConfEngine *conf, gboolean is_writable = TRUE; char *schema_name = NULL; DBusMessage *message, *reply; + DBusError error; g_return_val_if_fail(conf != NULL, NULL); g_return_val_if_fail(key != NULL, NULL); @@ -822,7 +831,7 @@ gconf_engine_get_fuller (GConfEngine *conf, g_assert(!gconf_engine_is_local(conf)); RETRY: - + db = gconf_engine_get_database (conf, TRUE, err); if (db == -1) @@ -844,21 +853,25 @@ gconf_engine_get_fuller (GConfEngine *conf, DBUS_TYPE_BOOLEAN, use_schema_default, 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken (reply)) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } - if (gconf_handle_dbus_exception(reply, err)) + if (gconf_handle_dbus_exception(reply, &error, err)) { - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return NULL; } else @@ -986,6 +999,7 @@ gconf_engine_get_default_from_schema (GConfEngine* conf, DBusMessage *message, *reply; int db; gint tries = 0; + DBusError error; g_return_val_if_fail(conf != NULL, NULL); g_return_val_if_fail(key != NULL, NULL); @@ -1034,23 +1048,25 @@ gconf_engine_get_default_from_schema (GConfEngine* conf, DBUS_TYPE_STRING, gconf_current_locale(), 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); - if (gconf_server_broken(reply)) - { - if (tries < MAX_RETRIES) - { - ++tries; - dbus_message_unref (reply); - gconf_engine_detach (conf); - goto RETRY; - } - } - - if (gconf_handle_dbus_exception (reply, err)) + if (gconf_server_broken (reply)) + if (tries < MAX_RETRIES) + { + ++tries; + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); + gconf_engine_detach (conf); + goto RETRY; + } + + if (gconf_handle_dbus_exception (reply, &error, err)) { - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return NULL; } else @@ -1074,7 +1090,8 @@ gconf_engine_set (GConfEngine* conf, const gchar* key, DBusMessage *message, *reply; int db; gint tries = 0; - + DBusError error; + g_return_val_if_fail(conf != NULL, FALSE); g_return_val_if_fail(key != NULL, FALSE); g_return_val_if_fail(value != NULL, FALSE); @@ -1133,21 +1150,24 @@ gconf_engine_set (GConfEngine* conf, const gchar* key, 0); gconf_dbus_fill_message_from_gconf_value (message, value); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken (reply)) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); gconf_engine_detach (conf); goto RETRY; } - if (gconf_handle_dbus_exception(reply, err)) + if (gconf_handle_dbus_exception(reply, &error, err)) { - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return FALSE; } g_return_val_if_fail(err == NULL || *err == NULL, FALSE); @@ -1161,7 +1181,8 @@ gconf_engine_unset (GConfEngine* conf, const gchar* key, GError** err) int db; gint tries = 0; DBusMessage *message, *reply; - + DBusError error; + g_return_val_if_fail (conf != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); g_return_val_if_fail (err == NULL || *err == NULL, FALSE); @@ -1210,21 +1231,25 @@ gconf_engine_unset (GConfEngine* conf, const gchar* key, GError** err) DBUS_TYPE_STRING, key, 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken (reply)) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } - if (gconf_handle_dbus_exception(reply, err)) + if (gconf_handle_dbus_exception(reply, &error, err)) { - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return FALSE; } @@ -1256,6 +1281,7 @@ gconf_engine_recursive_unset (GConfEngine *conf, gint tries = 0; guint dbus_flags; DBusMessage *message, *reply; + DBusError error; g_return_val_if_fail (conf != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); @@ -1310,7 +1336,8 @@ gconf_engine_recursive_unset (GConfEngine *conf, DBUS_TYPE_STRING, key, DBUS_TYPE_UINT32, dbus_flags, 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); @@ -1318,14 +1345,17 @@ gconf_engine_recursive_unset (GConfEngine *conf, if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } - if (gconf_handle_dbus_exception(reply, err)) + if (gconf_handle_dbus_exception(reply, &error, err)) { - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return FALSE; } @@ -1340,6 +1370,7 @@ gconf_engine_associate_schema (GConfEngine* conf, const gchar* key, { int db; DBusMessage *message, *reply; + DBusError error; gint tries = 0; @@ -1392,24 +1423,31 @@ gconf_engine_associate_schema (GConfEngine* conf, const gchar* key, DBUS_TYPE_STRING, key, DBUS_TYPE_STRING, schema_key, 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken (reply)) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } - if (gconf_handle_dbus_exception(reply, err)) + if (gconf_handle_dbus_exception(reply, &error, err)) { - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return FALSE; } + dbus_message_unref (reply); + g_return_val_if_fail (err == NULL || *err == NULL, FALSE); return TRUE; @@ -1448,7 +1486,8 @@ gconf_engine_all_entries(GConfEngine* conf, const gchar* dir, GError** err) int db; guint i; gint tries = 0; - + DBusError error; + g_return_val_if_fail(conf != NULL, NULL); g_return_val_if_fail(dir != NULL, NULL); g_return_val_if_fail(err == NULL || *err == NULL, NULL); @@ -1513,21 +1552,25 @@ gconf_engine_all_entries(GConfEngine* conf, const gchar* dir, GError** err) DBUS_TYPE_STRING, gconf_current_locale(), 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken (reply)) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } - if (gconf_handle_dbus_exception(reply, err)) + if (gconf_handle_dbus_exception(reply, &error, err)) { - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return NULL; } @@ -1587,6 +1630,7 @@ gconf_engine_all_dirs(GConfEngine* conf, const gchar* dir, GError** err) guint i; gint tries = 0; DBusMessage *message, *reply; + DBusError error; g_return_val_if_fail(conf != NULL, NULL); g_return_val_if_fail(dir != NULL, NULL); @@ -1643,28 +1687,33 @@ gconf_engine_all_dirs(GConfEngine* conf, const gchar* dir, GError** err) DBUS_TYPE_UINT32, db, DBUS_TYPE_STRING, dir, 0); - - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken (reply)) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } - if (gconf_handle_dbus_exception(reply, err)) + if (gconf_handle_dbus_exception(reply, &error, err)) { - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return NULL; } dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING_ARRAY, &keys, &len, 0); + dbus_message_unref (reply); i = 0; while (i < len) { @@ -1689,7 +1738,8 @@ gconf_engine_suggest_sync(GConfEngine* conf, GError** err) DBusMessage *message, *reply; int db; gint tries = 0; - + DBusError error; + g_return_if_fail(conf != NULL); g_return_if_fail(err == NULL || *err == NULL); @@ -1734,22 +1784,26 @@ gconf_engine_suggest_sync(GConfEngine* conf, GError** err) DBUS_TYPE_UINT32, db, 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken (reply)) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } - if (gconf_handle_dbus_exception(reply, err)) + if (gconf_handle_dbus_exception(reply, &error, err)) g_return_if_fail (err == NULL || *err == NULL); - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); } void @@ -1758,7 +1812,8 @@ gconf_clear_cache(GConfEngine* conf, GError** err) DBusMessage *message, *reply; int db; gint tries = 0; - + DBusError error; + g_return_if_fail(conf != NULL); g_return_if_fail(err == NULL || *err == NULL); @@ -1805,22 +1860,26 @@ gconf_clear_cache(GConfEngine* conf, GError** err) DBUS_TYPE_UINT32, db, 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken (reply)) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } - if (gconf_handle_dbus_exception(reply, err)) + if (gconf_handle_dbus_exception(reply, &error, err)) g_return_if_fail (err == NULL || *err == NULL); - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); } void @@ -1829,7 +1888,8 @@ gconf_synchronous_sync(GConfEngine* conf, GError** err) DBusMessage *message, *reply; int db; gint tries = 0; - + DBusError error; + g_return_if_fail(conf != NULL); g_return_if_fail(err == NULL || *err == NULL); @@ -1871,22 +1931,26 @@ gconf_synchronous_sync(GConfEngine* conf, GError** err) DBUS_TYPE_UINT32, db, 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken (reply)) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } - if (gconf_handle_dbus_exception(reply, err)) + if (gconf_handle_dbus_exception(reply, &error, err)) g_return_if_fail (err == NULL || *err == NULL); - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); } gboolean @@ -1896,7 +1960,8 @@ gconf_engine_dir_exists(GConfEngine *conf, const gchar *dir, GError** err) gboolean exists; gint tries = 0; DBusMessage *message, *reply; - + DBusError error; + g_return_val_if_fail(conf != NULL, FALSE); g_return_val_if_fail(dir != NULL, FALSE); g_return_val_if_fail(err == NULL || *err == NULL, FALSE); @@ -1932,7 +1997,8 @@ gconf_engine_dir_exists(GConfEngine *conf, const gchar *dir, GError** err) DBUS_TYPE_STRING, dir, 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken(reply)) @@ -1940,15 +2006,18 @@ gconf_engine_dir_exists(GConfEngine *conf, const gchar *dir, GError** err) if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } } - if (gconf_handle_dbus_exception (reply, err)) + if (gconf_handle_dbus_exception (reply, &error, err)) { - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); return FALSE; } @@ -1967,7 +2036,8 @@ gconf_engine_remove_dir (GConfEngine* conf, int db; DBusMessage *message, *reply; gint tries = 0; - + DBusError error; + g_return_if_fail(conf != NULL); g_return_if_fail(dir != NULL); g_return_if_fail(err == NULL || *err == NULL); @@ -1994,14 +2064,15 @@ gconf_engine_remove_dir (GConfEngine* conf, return; } - + message = dbus_message_new (GCONF_DBUS_CONFIG_SERVER, GCONF_DBUS_CONFIG_DATABASE_REMOVE_DIR); dbus_message_append_args (message, DBUS_TYPE_UINT32, db, DBUS_TYPE_STRING, dir, 0); - reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, NULL); + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (dbus_conn, message, -1, &error); dbus_message_unref (message); if (gconf_server_broken(reply)) @@ -2009,15 +2080,18 @@ gconf_engine_remove_dir (GConfEngine* conf, if (tries < MAX_RETRIES) { ++tries; - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); + dbus_error_free (&error); gconf_engine_detach (conf); goto RETRY; } } - gconf_handle_dbus_exception (reply, err); + gconf_handle_dbus_exception (reply, &error, err); - dbus_message_unref (reply); + if (reply) + dbus_message_unref (reply); } gboolean @@ -2094,26 +2168,24 @@ gconf_cnxn_notify(GConfCnxn* cnxn, static ConfigServer server = CORBA_OBJECT_NIL; /* errors in here should be GCONF_ERROR_NO_SERVER */ -static ConfigServer +static gboolean try_to_contact_server (gboolean start_if_not_found, GError **err) { - CORBA_Environment ev; - /* Try to launch server */ - server = gconf_activate_server (start_if_not_found, - err); - + daemon_running = gconf_activate_server (dbus_conn, start_if_not_found, + err); + +#ifdef GCONF_CORBA_BROKEN /* Try to ping server, by adding ourselves as a client */ CORBA_exception_init (&ev); + if (!CORBA_Object_is_nil (server, &ev)) { -#ifdef GCONF_CORBA_BROKEN ConfigServer_add_client (server, gconf_get_config_listener (), &ev); -#endif if (ev._major != CORBA_NO_EXCEPTION) { g_set_error (err, @@ -2129,26 +2201,30 @@ try_to_contact_server (gboolean start_if_not_found, } #ifdef GCONF_ENABLE_DEBUG - if (server == CORBA_OBJECT_NIL && start_if_not_found) - g_return_val_if_fail (err == NULL || *err != NULL, server); + if (!daemon_running && start_if_not_found) + g_return_val_if_fail (err == NULL || *err != NULL, daemon_running); #endif + +#endif - return server; + return daemon_running; } /* All errors set in here should be GCONF_ERROR_NO_SERVER; should only set errors if start_if_not_found is TRUE */ -static ConfigServer +static gboolean gconf_get_config_server(gboolean start_if_not_found, GError** err) { - g_return_val_if_fail(err == NULL || *err == NULL, server); + gboolean retval; - if (server != CORBA_OBJECT_NIL) - return server; + g_return_val_if_fail(err == NULL || *err == NULL, daemon_running); - server = try_to_contact_server(start_if_not_found, err); + if (daemon_running) + return TRUE; - return server; /* return what we have, NIL or not */ + daemon_running = try_to_contact_server(start_if_not_found, err); + + return daemon_running; /* return what we have */ } ConfigListener listener = CORBA_OBJECT_NIL; @@ -2534,7 +2610,6 @@ gconf_lifecycle_handler (DBusMessageHandler *handler, if (strcmp (name, GCONF_DBUS_CONFIG_SERVER) == 0) { - printf ("Daemon is gone\n"); daemon_running = FALSE; } } @@ -2921,20 +2996,6 @@ gconf_unique_key (void) * Table of connections */ -static gint -corba_unsigned_long_equal (gconstpointer v1, - gconstpointer v2) -{ - return *((const CORBA_unsigned_long*) v1) == *((const CORBA_unsigned_long*) v2); -} - -static guint -corba_unsigned_long_hash (gconstpointer v) -{ - /* for our purposes we can just assume 32 bits are significant */ - return (guint)(*(const CORBA_unsigned_long*) v); -} - static CnxnTable* ctable_new(void) { @@ -3103,24 +3164,20 @@ gconf_shutdown_daemon (GError** err) gboolean gconf_ping_daemon(void) { - ConfigServer cs; - - cs = gconf_get_config_server(FALSE, NULL); /* ignore error, since whole point is to see if server is reachable */ - - if (cs == CORBA_OBJECT_NIL) + if (!ensure_dbus_connection ()) return FALSE; - else - return TRUE; + + return gconf_get_config_server(FALSE, NULL); /* ignore error, since whole point is to see if server is reachable */ } gboolean gconf_spawn_daemon(GError** err) { - ConfigServer cs; - - cs = gconf_get_config_server(TRUE, err); + gboolean retval; + + retval = gconf_get_config_server(TRUE, err); - if (cs == CORBA_OBJECT_NIL) + if (!retval) { g_return_val_if_fail(err == NULL || *err != NULL, FALSE); return FALSE; /* Failed to spawn, error should be set */ @@ -3651,34 +3708,35 @@ dbus_error_name_to_gconf_errno (const char *name) static gboolean gconf_server_broken(DBusMessage *message) { -#ifdef GCONF_CORBA_BROKEN - switch (ev->_major) + const char *name; + + /* A server that doesn't reply is a broken server. */ + if (!message) { - case CORBA_SYSTEM_EXCEPTION: + daemon_running = FALSE; return TRUE; - break; - - case CORBA_USER_EXCEPTION: - { - ConfigException* ce; - - ce = CORBA_exception_value(ev); + } + + if (!dbus_message_get_is_error (message)) + return FALSE; - return ce->err_no == ConfigInShutdown; - } - break; - - default: - return FALSE; - break; + name = dbus_message_get_name (message); + + if (g_str_has_prefix (name, "org.freedesktop.DBus.Error")) + { + daemon_running = FALSE; + return TRUE; } -#endif - return FALSE; + else if (strcmp (name, GCONF_DBUS_ERROR_IN_SHUTDOWN)) + return TRUE; + else + return FALSE; } static gboolean -gconf_handle_dbus_exception (DBusMessage *message, GError** err) +gconf_handle_dbus_exception (DBusMessage *message, DBusError *dbus_error, + GError** err) { char *error_string; const char *name; diff --git a/gconf/gconfd-dbus.c b/gconf/gconfd-dbus.c index 6db7f1b5..cdb1bc58 100644 --- a/gconf/gconfd-dbus.c +++ b/gconf/gconfd-dbus.c @@ -24,9 +24,12 @@ #include "gconf-dbus.h" #include <time.h> #include <string.h> +#include <sys/types.h> +#include <unistd.h> static const char *config_server_messages[] = { GCONF_DBUS_CONFIG_SERVER_SHUTDOWN, + GCONF_DBUS_CONFIG_SERVER_PING }; static const char *config_database_messages[] = { @@ -75,6 +78,23 @@ gconfd_shutdown (DBusConnection *connection, gconf_main_quit(); } +static void +gconfd_ping (DBusConnection *connection, + DBusMessage *message) +{ + DBusMessage *reply; + + if (gconfd_dbus_check_in_shutdown (connection, message)) + return; + + reply = dbus_message_new_reply (message); + dbus_message_append_args (reply, + DBUS_TYPE_UINT32, getpid (), + 0); + dbus_connection_send (connection, reply, NULL); + dbus_message_unref (reply); +} + static DBusHandlerResult gconfd_config_server_handler (DBusMessageHandler *handler, DBusConnection *connection, @@ -87,7 +107,11 @@ gconfd_config_server_handler (DBusMessageHandler *handler, return DBUS_HANDLER_RESULT_REMOVE_MESSAGE; } - + else if (dbus_message_name_is (message, GCONF_DBUS_CONFIG_SERVER_PING)) + { + add_client (connection, dbus_message_get_sender (message)); + gconfd_ping (connection, message); + } return DBUS_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } @@ -97,7 +121,7 @@ gconf_dbus_set_exception (DBusConnection *connection, GError **error) { GConfError en; - const char *name; + const char *name = NULL; DBusMessage *reply; if (error == NULL || *error == NULL) @@ -643,11 +667,8 @@ gconfd_config_database_remove_listener (DBusConnection *connection, { GConfDatabase *db; DBusMessage *reply; - DBusDict *dict; - char *dir; int id; int cnxn; - const char *name = NULL; if (gconfd_dbus_check_in_shutdown (connection, message)) return; @@ -659,12 +680,10 @@ gconfd_config_database_remove_listener (DBusConnection *connection, return; if (!(db = gconf_database_from_id (connection, message, id))) - { - dbus_free (dir); return; - } - gconf_database_corba_remove_listener (db, cnxn); + + /* FIXME: Remove the listener */ reply = dbus_message_new_reply (message); dbus_connection_send (connection, reply, NULL); @@ -1143,7 +1162,7 @@ static const char * get_dbus_address (void) { /* FIXME: Change this when we know how to find the message bus. */ - return g_getenv ("GCONF_DBUS_ADDRESS"); + return g_getenv ("DBUS_ADDRESS"); } static DBusConnection *dbus_conn = NULL; @@ -1155,7 +1174,6 @@ gconfd_dbus_init (void) DBusResultCode result; DBusMessageHandler *handler; DBusError error; - char *name; dbus_error_init (&error); dbus_address = get_dbus_address (); @@ -1174,8 +1192,7 @@ gconfd_dbus_init (void) return FALSE; } - name = dbus_bus_register_client (dbus_conn, &error); - if (!name) + if (!dbus_bus_register (dbus_conn, &error)) { gconf_log (GCL_ERR, _("Failed to register client with the D-BUS bus daemon: %s"), error.message); diff --git a/gconf/gconftool.c b/gconf/gconftool.c index 9857a8a8..aa0e34e5 100644 --- a/gconf/gconftool.c +++ b/gconf/gconftool.c @@ -401,7 +401,7 @@ static const char * get_dbus_address (void) { /* FIXME: Change this when we know how to find the message bus. */ - return g_getenv ("GCONF_DBUS_ADDRESS"); + return g_getenv ("DBUS_ADDRESS"); } @@ -412,7 +412,6 @@ setup_dbus (void) const char *dbus_address; DBusError error; DBusResultCode result; - char *name; dbus_address = get_dbus_address (); if (!dbus_address) @@ -429,8 +428,7 @@ setup_dbus (void) return FALSE; } - name = dbus_bus_register_client (dbus_conn, &error); - if (!name) + if (!dbus_bus_register (dbus_conn, &error)) { g_printerr (_("Failed to register client with the D-BUS bus daemon: %s"), error.message); @@ -438,8 +436,6 @@ setup_dbus (void) return FALSE; } - dbus_free (name); - return gconf_init_dbus (dbus_conn); } diff --git a/gconf/simple-test.c b/gconf/simple-test.c index 1fd9e7a6..047c7ae2 100644 --- a/gconf/simple-test.c +++ b/gconf/simple-test.c @@ -99,7 +99,7 @@ notify_func (GConfClient* client, static gboolean idle_func (GConfClient *client) { - // gconf_client_set_string (client, "/desktop/gnome/interface/icon_theme", "Anders rocks", NULL); + return FALSE; } @@ -110,11 +110,10 @@ main (int argc, char **argv) DBusConnection *connection; DBusResultCode result; const char *address; - char *name; GMainLoop *loop; DBusError error; - address = g_getenv ("GCONF_DBUS_ADDRESS"); + address = g_getenv ("DBUS_ADDRESS"); connection = dbus_connection_open (address, &result); if (!connection) @@ -125,8 +124,7 @@ main (int argc, char **argv) } dbus_error_init (&error); - name = dbus_bus_register_client (connection, &error); - if (!name) + if (!dbus_bus_register (connection, &error)) { g_printerr ("Failed to register client with the D-BUS bus daemon: %s", error.message); @@ -136,27 +134,14 @@ main (int argc, char **argv) g_type_init (); gconf_init_dbus (connection); - - client = gconf_client_get_default (); - g_idle_add (idle_func, client); - - gconf_client_add_dir (client, "/desktop/gnome", - GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - gconf_client_notify_add (client, "/desktop/gnome", - notify_func, NULL, NULL, NULL); - loop = g_main_loop_new (NULL, FALSE); - - dbus_connection_setup_with_g_main (connection); - - g_main_loop_run (loop); + client = gconf_client_get_default (); - g_print ("foo: %s\n", gconf_client_get_string (client, "/desktop/gnome/interface/icon_theme", NULL)); - g_print ("foo: %d\n", gconf_client_dir_exists (client, "/desktop/gnome/interface", NULL)); + gconf_shutdown_daemon (NULL); - recurse (client, "/", 0); + g_print ("foo: %s\n", gconf_client_get_string (client, "/desktop/gnome/interface/icon_theme", NULL)); return 0; } diff --git a/gconfd.service.in b/gconfd.service.in new file mode 100644 index 00000000..f40a92b5 --- /dev/null +++ b/gconfd.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.gnome.GConf.Server +Exec=@LIBEXECDIR@/gconfd-2 diff --git a/tests/dbus-glue.c b/tests/dbus-glue.c index b87b0f64..2a0a6f73 100644 --- a/tests/dbus-glue.c +++ b/tests/dbus-glue.c @@ -6,7 +6,7 @@ static const char * get_dbus_address (void) { /* FIXME: Change this when we know how to find the message bus. */ - return g_getenv ("GCONF_DBUS_ADDRESS"); + return g_getenv ("DBUS_ADDRESS"); } gboolean @@ -15,33 +15,32 @@ setup_dbus (void) static DBusConnection *dbus_conn = NULL; const char *dbus_address; DBusResultCode result; - char *name; + DBusError error; dbus_address = get_dbus_address (); if (!dbus_address) { - g_printerr ("Failed to get the D-BUS bus daemon address"); + g_printerr ("Failed to get the D-BUS bus daemon address.\n"); return FALSE; } + dbus_error_init (&error); dbus_conn = dbus_connection_open (dbus_address, &result); if (!dbus_conn) { - g_printerr ("Failed to connect to the D-BUS bus daemon: %s", + g_printerr ("Failed to connect to the D-BUS bus daemon: %s\n", dbus_result_to_string (result)); return FALSE; } - name = dbus_bus_register_client (dbus_conn, &result); - if (!name) + dbus_error_init (&error); + if (!dbus_bus_register (dbus_conn, &error)) { - g_printerr ("Failed to register client with the D-BUS bus daemon: %s", - dbus_result_to_string (result)); + g_printerr ("Failed to register client with the D-BUS bus daemon: %s\n", + error.message); return FALSE; } - dbus_free (name); - return gconf_init_dbus (dbus_conn); } diff --git a/tests/testactivationraces.sh b/tests/testactivationraces.sh index d1fc121c..4d74f0ea 100755 --- a/tests/testactivationraces.sh +++ b/tests/testactivationraces.sh @@ -11,18 +11,18 @@ mkdir $TMPDIR || true for I in `seq 1 $COUNT`; do TMPFILE=`mktemp $TMPDIR/SET.$I.XXXXXX` || exit 1 - gconftool --type=int --set /test/foo $I & + ../gconf/gconftool-2 --type=int --set /test/foo $I & TMPFILE=`mktemp $TMPDIR/SHUTDOWN.$I.XXXXXX` || exit 1 - gconftool --shutdown & + ../gconf/gconftool-2 --shutdown & TMPFILE=`mktemp $TMPDIR/GET.$I.XXXXXX` || exit 1 - gconftool --get /test/foo & + ../gconf/gconftool-2 --get /test/foo & TMPFILE=`mktemp $TMPDIR/SHUTDOWN2.$I.XXXXXX` || exit 1 - gconftool --shutdown & + ../gconf/gconftool-2 --shutdown & done for I in `seq 1 $COUNT`; do TMPFILE=`mktemp $TMPDIR/SET2.$I.XXXXXX` || exit 1 - gconftool --type=int --set /test/foo $I & + ../gconf/gconftool-2 --type=int --set /test/foo $I & TMPFILE=`mktemp $TMPDIR/SHUTDOWN3.$I.XXXXXX` || exit 1 - gconftool --shutdown & + ../gconf/gconftool-2 --shutdown & done |